borris83
03-30-2009, 05:57 AM
Hi,
If I receive a decimal value 3.5 for a variable, is there any function to change it to 4, the nearest whole number...
I have the following code in a page:
$pages = mysql_num_rows($result)/7;
But if the value I receive for mysql_num_rows($result)/7 is a decimal number, I want to apply a function which will convert the floating point to the closest higher integer...
For eg, if it is 6.57 then the result should be 7;
If it is 19.3, then the result should be 20
If I receive a decimal value 3.5 for a variable, is there any function to change it to 4, the nearest whole number...
I have the following code in a page:
$pages = mysql_num_rows($result)/7;
But if the value I receive for mysql_num_rows($result)/7 is a decimal number, I want to apply a function which will convert the floating point to the closest higher integer...
For eg, if it is 6.57 then the result should be 7;
If it is 19.3, then the result should be 20