Trouble adding numbers with 12 decimals in PHP and MySQL
In my database I have numbers stored as decimal(16,12) like this:
1.000100000000
3.000100010001
10.000500020003
If I just grab them and echo them to the screen they return correctly but if I try to get the sum of them either in MySQL using
sum(nums) AS num
or grabbing them and then with PHP looping through them and using
$tot +=
they do not add correctly and it is DRIVING ME CRAZY :)
If anyone has any ideas I'd really appreciate a point in the right direction.
William.
|