-
Notifications
You must be signed in to change notification settings - Fork 89
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
Feature request (or help request) #219
Comments
There isn't a way to do this right now and two issues prevent it: there isn't a way to just parse Let me know if the resolution of those two issues will resolve your problem so we can mark this issue complete. |
Yup, those will definitely cover it! |
I suppose a stopgap solution would be to parse "1 {unit}" and multiply by the untyped quantity |
Marking this issue closed since the other two cover the functionality needed. Please re-open if I missed anything! |
For those finding there way here looking for a way to do this before the features land, I've found that |
Is it possible to instantiate a
Quantity
with a known type but a runtime unit of measure? For instance, suppose I have the float value2.5
and the string"km"
. Is there any way to parse that aside from formatting the quantity back into a string and usingFromStr
? If not, this is a feature request from a constructor or an enum of different unit measures of a each type that can be parsed and used to construct quantities.The text was updated successfully, but these errors were encountered: