ceil() in php

Wednesday, November 5, 2008 23:16
Posted in category PHP, Programming

The ceil() function Returns an integer that is the next larger than the float used as the argument. In essence, it rounds up a floating-point number to an integer, no matter what the value of the floating-point integer is. It doesn’t round down.

Example#1 ceil() example

< ?php
echo ceil(4.3); // 5
echo ceil(9.999); // 10
echo ceil(-3.14); // -3
?>

Returns

Integer on success; FALSE on error

You can leave a response, or trackback from your own site.

Leave a Reply