I'm not quite sure why anyone would need a 'decimal' data type for currencies?
Couldn't you just express everything in eg cents, if you want that?
Otherwise, many languages also have libraries for working with exact rational numbers.
Couldn't you just express everything in eg cents, if you want that?
Otherwise, many languages also have libraries for working with exact rational numbers.
Cents was just an example. Old British currency used to be even crazier than your example of a unit divided into 1,000.
> But, the moment you need to convert from KWD to VND (84000.00:1) you could be at the edge of the size of a 64 bit int.
So? You should use arbitrary length integers for that. Many languages have good support for them. Eg in Python they are the default integer you get.