How i turn like 1592.50 into 1593 with php?
i want a way to check if the number has comma, th开发者_StackOverflow中文版en it return it into the next number.
example :
<?
$mynum = "6265.50";
// output : 6266 , and not 6,266 like the function of number_format()
?>
Thanks
You can use round();
or ceil()
to round up fractions.
http://php.net/manual/en/function.ceil.php
You are looking for the ceil
function :
$mynum = "6265.50";
echo ceil($mynum);
will give you :
6266
use ceil($mynum)
echo ceil(6265.50);
精彩评论