Answers for "ceil function php"

PHP
2

round up built in function php

echo ceil(0.5); //Prints 1
Posted by: Guest on March-03-2020
0

floor ceil php

echo(floor(0.60) . "<br>"); // 0
echo(floor(0.40) . "<br>"); // 0
echo(floor(5) . "<br>"); // 5
echo(floor(5.1) . "<br>"); //5
echo(floor(-5.1) . "<br>"); // -6
echo(floor(-5.9)); // -6

echo(ceil(0.60) . "<br>"); // 1
echo(ceil(0.40) . "<br>"); // 1
echo(ceil(5) . "<br>"); // 5
echo(ceil(5.1) . "<br>"); // 6
echo(ceil(-5.1) . "<br>"); // -5
echo(ceil(-5.9)); // -5
Posted by: Guest on January-02-2021

Browse Popular Code Answers by Language