Many languages also have libraries (or standard libraries) for supporting arbitrary length and precision 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.
PICTURE IS $-999,999.99
which defines a signed money value represented in decimal. If you print that value, it will be formatted as requested.There are a few other formatting characters. A "CR" at the end will cause negative numbers to be printed with "CR" (Credit) at the end. A "Z" causes lead zero suppression. "*" causes lead zeros to be replaced with asterisks, for check-writing. Numeric display formatting is an attribute of the data.
That concept, and built-in support of money-like values, has been lost in later languages. In Rust you can have implicit Display or Debug functions for types, although it's mostly used for debugging.
Mixing value and presentation wasn’t the brightest idea. In their defence, everything was new at the time, and everywhere they were breaking new ground.
Spreadsheets still do that.