I have found the function floor that rounds an integer. Is there any function that always rounds up, i.e. 2.1 to 3?
Thanks, Henrik
http://www.php.net/manual/en/ref.math.php
try this:
$value=2.1; $value=(int)$value+1;
thanks, but I found the function ceil which rounds fractions up.
/ Henrik
Ehm... do you happen to work for microsoft? :-)
not yet! 🙂
🙂 I meant it for "nocontrol". Looks like a MS tactic: -Take a float. -Turn it into an int (chopping off the fraction) -Add one to the result.
ahh 🙂)
lucky that we have php and ceil then! 🙂
late, but i have to answer....
but first i have some questions: have you ever programmed in C? which way the php-rounding function does it? what's faster, not to code but to run?
now my answer: no i've never worked for ms.
General note: I was tought to always check if a function is available in a languages before I start writing by own routines.