-
Notifications
You must be signed in to change notification settings - Fork 395
Adding method to convert quantity into another quantity #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I wonder if we should obsolete the ToString overloads that take a unit? For example string1 and string2 should be the same here: var someAcceleration = Acceleration.FromMetersPerSecondSquared( 9.8 );
var someAccelerationInInchesPerSecondSquared = someAcceleration.AsQuantity( AccelerationUnit.InchPerSecondSquared );
var string1 = someAcceleration.ToString( AccelerationUnit.InchPerSecondSquared );
var string2 = someAccelerationInInchesPerSecondSquared.ToString(); It makes the fact you're doing a conversion explicit, and ToString is responsible only for how that particular unit is displayed - not converting and displayed. It would also make ToString available from an interface. |
|
|
|
We'll think about point 1 for another PR :) I think that sounds good - I've renamed this method ToUnit. We could address the other methods later. |
No description provided.