Heres a nice function I made for my pagination that rounds to the next number if the number is greater than the whole number.
EX: 2.000001 will return 3
2.5 will return 3
2 will return 2
1.9 or 1.3 etc will return 2
Can use it as long as copyright remains intact.
<?php function round_up($Number) {
// Copyright Josh Acecool M http://www.acecoolco.com
if ($Number > number_format($Number, "0")) {
$Number = round($Number);
$Number++;
}
else
{
$Number = number_format($Number, "0");
}
return $Number;
} ?>
|
|