Thread: decimal
View Single Post
Old November 3rd, 2005, 10:17 PM
robprell robprell is offline
Friend of Wrox
Join Date: Aug 2004
Location: Orange County, CA, USA.
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts

The problem is likely you allow php to define your variable types. If the first value that goes into your total is a 1, then the next is a 2.34. The variable may already be dimensioned in a way that doesn't allow the 2.34. Try to explicity define the data types of your variables to allow 9.97 or whaterver is your max value and see if you get different results. It is a lazy (bad) coding practice to allow php to define your variable types for you.