3 ms·
But decimal are way more useful as they can represent currency amounts. It would be strange to show a currency amount like "3/4" or "11/12". Personally, the two
by sirk390 5y ago
But decimal are way more useful as they can represent currency amounts. It would be strange to show a currency amount like "3/4" or "11/12".
Personally, the two datatypes I have always been adding manually to json are datetimes and decimals (from python)
- otabdeveloper4 5y agoA currency amount is just a rational number with "1000000" as a denominator. This is the correct representation, and how Google or the blockchain do it.
- sirk390 5y agoI don't thing there is a more "correct" representation. Representing it as a string is equaly correct. Blockchain or banking often represents money as an integer with the smallest divisible unit (cent, or satoshi), but it is not applicable here because there is no smallest divisible unit.