View Full Version : float not accept correct update

07-24-2006, 12:20 PM
have a table donations with the following field:
amount float(10,2)

If I have a record with amount = 98765432.00

and then I try to do the following update:
UPDATE donations SET amount = "98765430.00" WHERE (donations_id = "31948")

The update seems to work and there are no errors but when I go to look at the record the amount is still

Any ideas? I can't figure out why it's doing this - and sometimes the number is updated but to something other then what was in the update...

I've tried this with amount decimal(10,2) and have the same problem.

Thanks in advance.

07-24-2006, 02:07 PM
use decimal(10,2) not float. float stores an approximation of the number, decimal stores the number you want it to store.

07-27-2006, 10:02 PM
Thanks that worked!
I tried that once before but I must have done something wrong - but now it's working fine.