Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is fine as long as you don’t cross any edge cases (crypto, or more recently stuff like AI token pricing) and don’t forget to account for third party quirks (e.g. Stripe’s zero-decimal currencies: https://docs.stripe.com/currencies#zero-decimal).


JPY not having any minor units is arguably not a “third party quirk” but just how the currency works. The same goes for various three decimal digit currencies.


I mean yeah, but it does make things more complicated. Currencies change to 0-decimal, but some systems still expect 2-decimal representation for backcompat reasons (like ISK and UGX in Stripe).


(To clarify some more, we’re in agreement here. My point was mainly that “just storing cents” seems like an easy solution and it might seem to be working well – until it’s not :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: