-
Notifications
You must be signed in to change notification settings - Fork 14
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
Cldr.Unit.Conversion does not deal with decimal values #8
Comments
Yes, it should support Decimal since all the Cldr libs should be consistent in this respect. Will add it to the weekend list to fix. |
Fixed, sorry it took so long. Published on hex as version 1.2.2 |
Can we make cldr_unit use only decimals internally? ex_cldr does depend on decimal anyways and results like the ones below just aren't nice to work with. (this is on 1.3.0)
|
Actually its all decimal calculations for a But even using decimals, the current conversion strategy, which always has two steps: to a common unit, then to the desired unit, has issues. For example:
So two thoughts:
|
@kipcole9 Maybe we can just flip the numbers from representing fractions of the smallest unit to be how many of the smallest unit fits into the current one: https://gist.github.com/LostKobrakai/4419bd3c245272e2fc04ef857c3e0f4a |
As cldr is already requiring the decimal library, couldn't
Cldr.Unit
normalize to just using Decimal internally?The text was updated successfully, but these errors were encountered: