Wrong rounding with some decimals on round_decimal

Anderson Santos avatarAnderson Santos created an issue

We are having a problem with wrong Balance Forward which is caused by the rounding on round_decimal function through trunc_decimal.

When trying the function like the following:


instead of rounding it only to 58.90, it's calculating 58.91

that's caused in the line 103 of satchmo_utils/numbers.py


I can't figure out how to improve this line. When I was thinking of writing a testcase for it I found out that there's already a failing test case with this issue but it's commented out on the test suit


I couldn't find the issue regarding this problem, not sure if there's one, but considering this line it's a known issue. Any perspective on solving this problem?

Comments (1)

  1. Alex Zagorodniuk

    i have the same issue. and i also traced it back to this line.


    it's pretty bad, customers get charged extra cent... But i don't think anybody is going to fix it.. :/

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.