-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove trailing zeroes in tax amount #4758
Remove trailing zeroes in tax amount #4758
Conversation
594e37c
to
6910fee
Compare
6910fee
to
a11f3ba
Compare
@Naokimi, could you please rebase from master to fix CI errors? 🙏 |
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.
Thanks! ❤️
NumberToPercentageConverter defaults to a precision of 3, leading to displays of VAT amount like '21.000%' on the cart's label, which doesn't look good. Using `precision: nil` will keep the default precision of the number.
a11f3ba
to
5483bc1
Compare
Codecov Report
@@ Coverage Diff @@
## master #4758 +/- ##
=======================================
Coverage 86.14% 86.14%
=======================================
Files 578 578
Lines 14654 14654
=======================================
Hits 12623 12623
Misses 2031 2031
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
💔 Some backports could not be created
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
💔 Some backports could not be created
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
@Naokimi, could you please manually backport it to v3.1? The automatic backporting failed because of merge conflicts 🙏 |
This now adds a trailing zero to all VAT tax rates in ie. German stores, but we want no precision at all so we used the locale file to set the format. # de.yml
de:
number:
percentage:
format:
precision: 0 Now we cannot control the format with locale files anymore. # en.yml
en:
number:
percentage:
format:
precision: 1 in the Can we please revert this? @solidusio/core-team |
Revert PR #4824 |
I added a commit to #4824 that changes the default precision of EN stores to 1 (instead of the Rails default of 3). This should fix what this PR tried to fix for all EN based stores. |
Summary
Issue
amount_for_adjustment_label
usesActiveSupport::NumberHelper::NumberToPercentageConverter
which defaults to a precision of 3, leading to the tax amount displayed in the label in a way that isn't very pleasing:Proposed Solution
Use amount's default precision
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed (
cross them outif they are not):I have opened a PR to update the guides.I have updated the readme to account for my changes.