Hey - I have a number stored in MySQL as an integer. How do I output: Number Stored in MySQL / 50 ? I need the output to be rounded up as a whole number. Eg 67 NOT 67.77 Thanks in advance
you have floor and ceil to round down and up respectively, and maths functions work as you would expect them to $num = 500; echo $num / 20.2323 ; echo "<br />"; echo floor( $num / 20.2323 ); echo "<br />"; echo ceil( $num / 20.2323 ); PHP: like that
krakjoe - Ok... so say I currently output the number like: $query="SELECT * FROM Cubez "; $sql=mysql_query($query); { while ($cubedata=mysql_fetch_object($sql)) { $msg.=" ".$cubedata->Number1. " "; PHP: Can I simply do: ".$cubedata->Number1 " / 50??
". $cubedata->Number1 / 50 . " - That works, but outputs the integer with a decimal point. How do I round it DOWN to a whole number. So if the answer is 56.78 it outputs 56??? Thanks a lot!!!
krakjoe - Thank you ever so much! Also... if you're interested, I have a few other small pieces of coding I could use some help with. I'm willing to pay! The site is www.you-cubez.com PM me if interested. Thanks