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 calculator values based on order currency #2877

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@ericsaupe
Contributor

ericsaupe commented Sep 27, 2018

Fixes #1957 by getting the exponent of the desired currency from Money::Currency

@tvdeyen

This makes sense. Thank you!

def compute(object)
computed_amount = (object.amount * preferred_flat_percent / 100).round(2)
currency_exponent = ::Money::Currency.find(preferred_currency).exponent

This comment has been minimized.

@kennyadsl

kennyadsl Oct 2, 2018

Member

Shouldn't be the currency taken from the order where the calculator lives instead?

@kennyadsl

kennyadsl Oct 2, 2018

Member

Shouldn't be the currency taken from the order where the calculator lives instead?

This comment has been minimized.

@ericsaupe

ericsaupe Oct 3, 2018

Contributor

Yeah, I like that better. I'll make the changes.

@ericsaupe

ericsaupe Oct 3, 2018

Contributor

Yeah, I like that better. I'll make the changes.

@ericsaupe

This comment has been minimized.

Show comment
Hide comment
@ericsaupe

ericsaupe Oct 10, 2018

Contributor

@kennyadsl this is ready to be looked at again. Thanks!

Contributor

ericsaupe commented Oct 10, 2018

@kennyadsl this is ready to be looked at again. Thanks!

@tvdeyen

Thanks.

Build issues should be fixed by rebasing with master.

Round calculator values based on order currency
Fixes #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