-
-
Notifications
You must be signed in to change notification settings - Fork 724
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 rounding issues by upgrading decimal maths library #12950
Fix rounding issues by upgrading decimal maths library #12950
Conversation
eea6606
to
31c8543
Compare
ef8aeb4
to
ae0b460
Compare
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.
I confess I've never needed to understand numbers at this level! I've added my thoughts, but I think this is ok as it is.
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.
Nice one!
I'm glad we have this in a separate pull request now because there's quite a bit to discuss. Awesome work and I think that this update will fix some rounding bugs in our app as well. I just have two little requests to make the code more readable and robust. Otherwise good to go.
ac4aa32
to
511aff9
Compare
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.
Nice, thanks @macanudo527 🙏
636868a
to
b79acf3
Compare
@mklink is there anything else needed for this one? |
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.
Sorry for the delay, as Maikel has been offline for the last week.
I can see that his feedback has been addressed, and this PR has already been added to the testing queue, we are just waiting for someone to verify with manual testing.
b79acf3
to
7a5074c
Compare
Hey @macanudo527, Same on my side, apologies for the delay in testing this one. I think it should close #7504. I've spotted this issue in two places in the app (pics taken before staging): Products page Variant edit page Interestingly, the first test case seems fixed: While the second one does not: I've pulled this PR to my local env and tested it locally, but still obtained the same result. I'm very tempted to merge this as it addresses the first test case. Any idea why the second case is not working @macanudo527 ? Adding the feedback needed label. |
Sorry, can you add more context? Which number did you enter and which number did you expect? The screenshots on their own look correct to me. |
@filipefurtad0 I think the numbers in the db will always be a little off due to float inaccuracies, but when you round up they will go away for the |
@mkllnk @macanudo527, apologies if the pictures are not clear: They relate to two test cases:
Ok, that makes sense. However, I was not expecting that the UI would still display 500.09 after staging the PR. After typing and saving the value or, creating a new variant with the value 500.1, then it is displayed correctly. Thanks for clarifying, merging! |
What? Why?
BigDecimal was version locked, but with some small modifications to a test and another small modification to display logic, it doesn't need to be. This allows us to use default gems on Alpine Docker images much easier. It also allows dependabot to automatically upgrade the gem when necessary.
What should we test?
trunc
to create the value instead ofround
.Release notes
BigDecimal will now be updated to the latest version more easily.
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.