-
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
#2379 - Fix computer multiplication in combine decimal places #2419
Conversation
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Thanks for the nice chat 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Floating point arithmetic issue in programming languages
https://stackoverflow.com/questions/45221535/javascript-floating-point-multiply-by-100-still-has-errors
Issue and fix
Certain decimal numbers when multiplied by 100 may not return precise mathematical result as we expect
Math.round()
seems to be one of the solutions to handle this issue.But in the
combineDecimalPlaces
method we are dividing and then multiplying by 100 again, which re-creates the same issue which was fixed byMath.round()
Hence: Divide and multiply of the rounded value by multiplier is removed.
File output