Android/SQLite : Saving/Retrieving data of type REAL
I think your problem is that you store the numbers as Float
. Float
does not have very good precision - it actually has only 23 binary digits of precision as seen here. This means that you can not store accurately in float
7 digits before the decimal point or even worse - 7 digits before the point and a couple after. This means that you have incorrectly chosen the type of the balance variable - you can not store in Float
8+2. I would recommend you to change the type to Double
, which has significantly larger range of precision.