Hacker News new | ask | show | jobs
by ivanmontillam 1 hour ago
A string type. As parent says: it completely bypasses the problem. Save the numbers between double quotes and be done with it.
1 comments

Storing numbers as arrays of u8? That doesn't make sense
For JSON serialization, which doesn't support fixed-point precision it does.

Floating-point precision has too many gotchas for being suitable to store Decimal types, especially for the Currency use case.