Hacker News new | ask | show | jobs
by saarons 2518 days ago
Totally agree on the interest use case, that's exactly where precision beyond 2 decimal places is needed. For payments specifically it makes sense to keep it at 2 because all the payment systems in the US have that precision. When we do build support for ledgers we've considered a few approaches for how that might be serialized. For example we sometimes deal with MasterCard data that tags every amount with an exponent field so something like 1.2345 might be serialized as

  { "amount": 12345, "exponent": 4 }
We could do that or something like:

  { "amount": "1.2345" }