September 2001
Intermediate to advanced
768 pages
32h 45m
English
int round(float num) Rounds a floating-point number to the nearest integer.
Returns:
Integer result of rounding
Description:
Rounds a floating-point number up or down to the nearest integer. If the floating-point portion is exactly 0.5, the function rounds up.
Version:
PHP 3, PHP 4
See also:
ceil() floor()
Example:
$number1 = 12.6; $number2 = 12.4; echo "Number 1: ", round($number1), "\n"; echo "Number 2: ", round($number2); |
Read now
Unlock full access