4 ms·
There is a larger point here, that 2500.5 JPY is not a valid amount to charge, thus having it be possible is a problem. Whereas 10000 USD cents is a valid valu
by scrollaway 6y ago
There is a larger point here, that 2500.5 JPY is not a valid amount to charge, thus having it be possible is a problem.
Whereas 10000 USD cents is a valid value.
Integer storage of money is my favourite as well to be honest. It's easy to work with and reason about, and it just makes decimalization a display issue.
- hn_throwaway_99 6y agoBut as others have pointed out, actual value can be fractional, it's just not priced that way. I mean, in the US it's actually pretty standard for accounting applications to use a scale of 4 (4 units to the right of the decimal point, the default for MONEY), even though people are never charged fractions of a cent. Simplest example someone gave is gas station pricing, in which prices often end in 9/10ths of a cent - the price is calculated that way, and only rounded when the customer pays.