Open TravisRobson opened 4 years ago
Doubles have ~14 significant digits of accuracy. If we need ~6 decimal places worth of accuracy to handle rounding, then 8 digits are left over for the dollar amount. This leaves you in the range of +-10 million. This should be sufficient for a personal finance project.
I will also need to decide how deal with rounding. You most likely don't want to round at every step of the calculation, which is currently what the money class does.
Either use this actually or for inspiration https://github.com/vpiotr/decimal_for_cpp
A nice discussion for the reasons behind this: https://stackoverflow.com/questions/149033/best-way-to-store-currency-values-in-c