You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I really like this Gem, it looks exactly like what we need. Thanks for all the work.
I'm trying to understand the best way to use Money for calculating amounts of money involving partial cents. For example, for a certain fee calculation, I need to always round up calculations if there is a fraction of cents. For example, if the fee is 2.2% on $1, I need to the result to always be $0.03. When I run Money.new(1, 'usd') * 0.022 though, I get the result of $0.02. I assume the gem has to handle this use-case so what is the correct way to handle this?
The text was updated successfully, but these errors were encountered:
We could expose the rounding option as an argument for the Money initializer and pass that along when we create a BigDecimal (see all modes here), so you'd get something like:
First off, I really like this Gem, it looks exactly like what we need. Thanks for all the work.
I'm trying to understand the best way to use Money for calculating amounts of money involving partial cents. For example, for a certain fee calculation, I need to always round up calculations if there is a fraction of cents. For example, if the fee is 2.2% on $1, I need to the result to always be $0.03. When I run
Money.new(1, 'usd') * 0.022
though, I get the result of $0.02. I assume the gem has to handle this use-case so what is the correct way to handle this?The text was updated successfully, but these errors were encountered: