|
Posted by Johannes Vogel on 02/22/07 10:36
Hi
Anonymous wrote:
> Jerry Stuckle wrote:
>> $num = int($num);
> I would advise against type casting. It can produce strage results under
> some circumstances.
> He would be better of using $num = floor($num), that's what the function
> is here for.
> ceil() always rounds up, floor() always rounds down, round() rounds
> according to mathematical rules (down on .0 to .4, up on .5 to .9
What's about minus values?
We don't know what the OP would like to get.
floor(-2.8) => -3
(int)-2.8 => -2
HTH, Johannes
Navigation:
[Reply to this message]
|