-
Notifications
You must be signed in to change notification settings - Fork 9
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
For currency, allow users to round to an arbitrary number of decimal places #75
Comments
How important is it to be able to set the rounding, vs just make sure that it rounds to the convention? e.g. do you ever want to see 4 decimals of USD, or is two decimals the most you want to see because thats the convention? Do you have a particular use case? (it helps me prioritize feature inclusion) |
For my personal purposes, I always use 2 decimal places for currency. But, for example, I see gas stations sell gas to the hundredth of a cent. I suggested rounding to an arbitrary decimal place because I assume other industries sometimes use different numerals. However, I suspect I am in the vast majority who prefer rounding currency to two decimal places. For whatever it's worth, I was able to find the mathjs documentation on this issue -- see the examples section. |
Currently, sometimes the results round to the nearest tenth. Sometimes, it rounds to the nearest 100th. Ideally, the user should be allowed to set what decimal place a currency result rounds to.
To be clear, numbers should format as follows if the user sets rounding to two (2) decimal places:
120 => 120.00 USD
120.1 => 120.10 USD
120.32 => 120.32 USD
120.35 => 120.36 USD
120.3499 => 120.34 USD
The text was updated successfully, but these errors were encountered: