note 10316 added to round
| From: | aryoung at unipass dot com | Date: | Wed, 27 Dec 2000 18:31:42 +0000 |
| Subject: | note 10316 added to round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9128@lists.php.net to get a copy of this message | ||
I wanted to round to the nearest 1000, and this is what I did
function my_rounder($value)
{
if ($value==0) return 0;
$buffer = $value / 1000;
$rounded = round($buffer);
$buffer = $rounded * 1000;
return $buffer;
}
http://www.php.net/manual/function.round.php