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
If I insert this value = 19.5455, the saved one is 19.5500
Expected behavior and actual behavior
Let the MoneyInput save the configured decimal digits.
Additional context
I debugged the code a little and found that the MoneyFormatter use the $moneyParser = new IntlLocalizedDecimalParser($numberFormatter, new ISOCurrencies);
I can understand that for Money calculations this configuration is correct and that at the end we need to round the final changes, so maybe this is not a bug, but for my use case is almost impossible to find a solution, ty very much.
The text was updated successfully, but these errors were encountered:
Thanks for the report!
Sorry for the late reply. I've been very busy the last month.
I was able to reproduce this. I looks like the number formatted gets properly configured with the MONEY_DECIMAL_DIGITS var, but IntlLocalizedDecimalParser does not respect that.
The problem is in IntlLocalizedDecimalParser as you said where it does not allow for more decimals then the minor unit for that currency. The only solution I can think of to fix this would be to allow that you inject your own Decimal parser that implements Money\MoneyParser and replaces IntlLocalizedDecimalParser.
Describe the bug
I have the next use case, which is to save 4 decimal digits:
Steps To Reproduce
.env
composer.json
If I insert this value = 19.5455, the saved one is 19.5500
Expected behavior and actual behavior
Let the MoneyInput save the configured decimal digits.
Additional context
I debugged the code a little and found that the MoneyFormatter use the $moneyParser = new IntlLocalizedDecimalParser($numberFormatter, new ISOCurrencies);
in which we have 2 minor units:
I can understand that for Money calculations this configuration is correct and that at the end we need to round the final changes, so maybe this is not a bug, but for my use case is almost impossible to find a solution, ty very much.
The text was updated successfully, but these errors were encountered: