Skip to content
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

fix: use Banker's Rounding in JS round_based_on_smallest_currency_fraction #6840

Merged

Conversation

SaiFi0102
Copy link
Collaborator

Problem:
The client side Rounded Total was being rounded using Math.round() which was causing an inconsistency between client-side calculation and server-side calculation which led to confusion.

Client-side Calculation Server-side Calculation
image image

Solution:
Use the _round() function rather than Math.round()

Fixed client-side calculation:
image

@sagarvora
Copy link
Collaborator

The parentheses in your PR title must match the affected module (e.g. accounts). They can be ignored in this case.

@sagarvora sagarvora changed the title fix(Rounded Total): Use Banker's Rounding in JS round_based_on_smallest_currency_fraction fix: use Banker's Rounding in JS round_based_on_smallest_currency_fraction Jan 29, 2019
@rmehta rmehta requested a review from nabinhait January 29, 2019 05:19
@nabinhait nabinhait merged commit a5db888 into frappe:staging-fixes Jan 29, 2019
@SaiFi0102 SaiFi0102 deleted the Fix-Rounding-Inconsistency branch February 3, 2019 19:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants