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

Round by currency fractional digits rather than by 2 digits #1957

Closed
jordan-brough opened this issue May 23, 2017 · 1 comment
Closed

Round by currency fractional digits rather than by 2 digits #1957

jordan-brough opened this issue May 23, 2017 · 1 comment

Comments

@jordan-brough
Copy link
Contributor

jordan-brough commented May 23, 2017

In places like this we have code like this:

computed_amount = (object.amount * preferred_flat_percent / 100).round(2)

The round(2) should really round by the number of fractional units for the order's currency. E.g. JPY has no fractional units and we should round to whole numbers.

@dgra
Copy link
Contributor

dgra commented May 23, 2017

I can take this.

ericsaupe added a commit to ericsaupe/solidus that referenced this issue Oct 15, 2018
Fixes solidusio#1957 by getting the exponent of the desired currency from
Money::Currency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants