-
Notifications
You must be signed in to change notification settings - Fork 19
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
Returning an exponent after adding a negative value that sums to 0.0000000 #23
Comments
I believe this is expected behaviour, as toString determines whether to use scientific notation based on the exponent, even for zero. The precision is preserved in the output. You should use toFixed(), or if that is not quite what you need, we may need to look at an adjustment of string representation. Just to be clear, was the expectation for this to return "0"? |
For the first 6 decimal places toString() will return 0.000000 (6) as soon as it hits the 7th decimal place it returns an exponent, hence I would have expected it to return 0.0000000 (7), this doesn't appear to happen if the value doesn't land on 0. Is there any way at current to make toString not return exponents if the decimal lands on a large precision number that equals 0? Or are you saying that toFixed will return the decimal representation rather than an exponent? As an example the above image returns all of the decimal places rather than an exponent for any other value than 0 |
Looks like a special case to me. This issue is along the same lines as #22 so I think we should reconsider how string formatting is done. Maybe:
|
aye the list looks good, consistency is the main take away. |
My only concern is that the default |
Let's roll with
I think that should work. |
See #22 (comment) |
@rtheunissen I've stumbled upon the same problem and saw that it had already been solved in 2.0. Is there any plan to release version 2.0 in the near future? |
Appears to happen at 7 decimal places on each side (at 6 it works fine), as long as it sums to 0
The text was updated successfully, but these errors were encountered: