View Full Version : Need help returning value as decimal

02-08-2010, 01:40 AM
Trying to modify this code slightly to allow the returned value to be in decimal format.


In this instance, the value in the database is 40.5, but is returning as 41. What do I need to add to that line of code to get it to display correctly as 40.5?

02-08-2010, 01:47 AM
Stop formatting it with the number_format function?

02-08-2010, 01:51 AM
Tried that...changed it to
$min=(mysql_result($result,$i,"minutes")); and still nothing.

02-08-2010, 01:53 AM
Nevermind...I'm a dolt. LOL


02-08-2010, 01:55 AM
That should be:


If it's 40.5 in the DB, and changing that line makes no difference, then the number is being rounded somewhere else.

Edit: Just seen your other post. Pipped whilst composing the post. :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum