SQLite Forum

Decimal128
Login
> Or... Or! We could just have some form of DECIMAL in SQLite.

You forgot the other option.

The problem is that money values look a lot like floats but they aren't.

They are countable values with a required precision (4 digits, to avoid divide-by-7-and-add-7-times errors) and display precision (2 digits), PLUS the digit significance changes over the lifetime of the coin, even in the space of years. 

So instead of creating an inefficient new type, you can also implement the calculations on this type properly: `FIXED_SUM(column, precision = 4)` etc. After every step you round to the precision.

Less work, same result but more efficiently.