...

View Full Version : PHP cant do its maths?



NancyJ
05-05-2006, 10:59 AM
This is what php tells me.
99.96 x 1.1 = 108.9
now my calculator tells me that the answer is 109.956 ... so whats going wrong?
If I use the numbers then its fine but if I use variables then it loses a bit somewhere.

mio
05-05-2006, 11:38 AM
hi,

try with BC extension
here for more information:
http://fr.php.net/manual/en/ref.bc.php

mio

NancyJ
05-05-2006, 11:44 AM
I cast as float and it seems to be ok now.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum