-
Notifications
You must be signed in to change notification settings - Fork 366
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
Custom units incompatible with decimal format? #1324
Comments
I'm not entirely sure what you are asking for. Are you not able to use However, you also need to implement
I know it is confusing, but generally we use |
So it is impossible to use e.g. a Length quantity that stores a decimal as an internal value? |
Yes, currently not possible to change numeric type of existing quantities, only custom quantities. We have discussed supporting generics many times before, but I don't see that moving forward anytime soon, so if you need |
Is your feature request related to a problem? Please describe.
I am trying to make a new quantity called RelativeDensity inheriting from IQuantity, but I need the underlying value to be full 128-bit decimal for precision reasons. From this pull request - #1084 - I was under the impression that QuantityValue, not double, was returned by types in UnitsNet.
Describe the solution you'd like
Add support for generic or just decimal custom quantities, and update the documentation - https://github.com/angularsen/UnitsNet/wiki/Extending-with-Custom-Units
Describe alternatives you've considered
I could try just submitting a pull request with a RelativeDensity quantity, since it just uses the same units as Density - but I have other quantities to add as well.
The text was updated successfully, but these errors were encountered: