SQLite Forum

"Office Space"... I'm losing all those pennies
Login
It is impossible to store the number 16.15 precisely in binary.  However you handle it, you're going to get truncation and/or rounding problems.  If you don't know why that is, take a course in computer science.

If you're building a financial application, amounts of money should be stored as integers.  Your value of $16.15 (or Euros, or Pounds, or whatever it is) should be stored as 1615 in column with INTEGER affinity, and your C code should handle all those values as integer values.  This will force you to handle truncation and rounding in your C code, without any ambiguity ("losing pennies").