Takes a number like 1000.000001 and rounds it to 1001, or 1000.9 and rounds it to 1001 I made this for my paginator which gets the total pages then divides by amount per page, sometimes it returns 1.1 or 1.00001 etc, so it rounds it up for a solid number to use for the paginator
Download
View Source (print view)
Rating : 4.7
Views : 1542
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;
}
?>
php and 0=1 union select keywords and 0=1 union select, php script and char(124) (select cast(count(1) as varchar(8000)) char(124) from [sysobjects] where 1=1)>0, fft, form to mail, "web page design in php", php_tools, php file upload, php keywords and 0=1 union select, rapiodshare, p t test paired, read mysql field, ringtonescript, form_to_mail, api, ring tone script, 'php script, call php', sms script, "web_page_design_in_php", pntvts, php keywords