- - Code, Content, and Presentation
- -- PHP Server Side Scripting
- ---- Miscalculation by PHP
lostdreamer - 9:19 am on Mar 14, 2012 (gmt 0)
#1: I would never ROUND first, then SUM... you could lose small bits of cents there.
If the amounts are off by a few cents, I'd start looking there.
sum(round(ot.value,2)) as usatotal
round(sum(ot.value),2) as usatotal
Let me know ;)
Thread source: http://www.webmasterworld.com/php/4428825.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com