Hacker News new | ask | show | jobs
by otabdeveloper4 1674 days ago
A 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.

1 comments

I 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.