Ouwe rakker |
|
Citaat: float floor ( float value )
Returns the next lowest integer value by rounding down value if necessary. The return value of floor() is still of type float because the value range of float is usually bigger than that of integer.
<?php
echo floor(4.3); // 4
echo floor(9.999); // 9
?>
Citaat: float ceil ( float value )
Returns the next highest integer value by rounding up value if necessary. The return value of ceil() is still of type float as the value range of float is usually bigger than that of integer.
<?php
echo ceil(4.3); // 5
echo ceil(9.999); // 10
?>
Citaat: float round ( float val [, int precision] )
Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default).
<?php
echo round(3.4); // 3
echo round(3.5); // 4
echo round(3.6); // 4
echo round(3.6, 0); // 4
echo round(1.95583, 2); // 1.96
echo round(1241757, -3); // 1242000
echo round(5.045, 2); // 5.05
echo round(5.055, 2); // 5.06
?>
|