note 85430 added to function.ceil
| From: | ScottWeaver/scottmweaver*gmail at osu1 dot php dot net | Date: | Fri, 29 Aug 2008 17:46:51 +0000 |
| Subject: | note 85430 added to function.ceil | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143988@lists.php.net to get a copy of this message | ||
I needed this and couldn't find it so I thought someone else wouldn't have to look through
a bunch of Google results-
<?php
// duplicates m$ excel's ceiling function
if( !function_exists('ceiling') )
{
function ceiling($number, $significance = 1)
{
return ( is_numeric($number) && is_numeric($significance) ) ?
(ceil($number/$significance)*$significance) : false;
}
}
echo ceiling(0, 1000); // 0
echo ceiling(1, 1); // 1000
echo ceiling(1001, 1000); // 2000
echo ceiling(1.27, 0.05); // 1.30
?>
----
Server IP: 64.71.164.2
Probable Submitter: 128.200.75.79
----
Manual Page -- http://www.php.net/manual/en/function.ceil.php
Edit -- https://master.php.net/note/edit/85430
Del: integrated -- https://master.php.net/note/delete/85430/integrated
Del: useless -- https://master.php.net/note/delete/85430/useless
Del: bad code -- https://master.php.net/note/delete/85430/bad+code
Del: spam -- https://master.php.net/note/delete/85430/spam
Del: non-english -- https://master.php.net/note/delete/85430/non-english
Del: in docs -- https://master.php.net/note/delete/85430/in+docs
Del: other reasons-- https://master.php.net/note/delete/85430
Reject -- https://master.php.net/note/reject/85430
Search -- https://master.php.net/manage/user-notes.php