I have a SQLDB with table of field REAL. In my layout I have set its field size to allow only 8+2 digits. In my object I have used the data-type of the field as \"float\".<
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.