Repository navigation
Currency based rounding in MoneyStrategy #4604
oroce
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
While using a custom MoneyStrategy works well for us, we are operating in multiple countries with various currencies that require different rounding rules.
For example, while a value of 2.70 is correct for EUR, CZK, or RON, a value of 2.70 HUF should be rounded to 3. In the Hungarian market, displaying non-rounded decimals is unconventional and can be misleading for customers.
Unfortunately, adjusting the global precision does not solve this issue because the requirement is currency-specific.
Proposed Solution
The ideal solution would be to update the MoneyStrategy interface so that its methods receive the CurrencyCode as an argument:
However if you have any idea to resolve this without passing currency to the MoneyStrategy I'm open to hear it.
Cheers
All reactions