What/Why
When given negative money, money_only_cents view helper does not return the expected subunit value due to how modulo handles negative numbers.
For example: -125 % 100 = 75
What was done
To fix, I've updated the calculation to use the absolute value and added a new spec to cover the use case.
What/Why When given negative money,
money_only_cents
view helper does not return the expected subunit value due to how modulo handles negative numbers. For example: -125 % 100 = 75What was done To fix, I've updated the calculation to use the absolute value and added a new spec to cover the use case.