O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

round

Synopsis

float round(float number[, int precision[, int mode]])

Returns the integer value nearest to number at the precision number of decimal places. The default for precision is 0 (integer rounding). The mode parameter dictates the method of rounding used:

PHP_ROUND_HALF_UP (default)

Round up

PHP_ROUND_HALF_DOWN

Round down

PHP_ROUND_HALF_EVEN

Round up if the significant digits are even

PHP_ROUND_HALF_ODD

Round down if the significant digits are odd

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required