note 87819 added to function.round
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 24 Dec 2008 01:31:35 +0000 |
| Subject: | note 87819 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148486@lists.php.net to get a copy of this message | ||
Precision rounding. Works for any value, including negative values, and values between 1 and 0.
function roundPrecision($value, $precision=3 ){
$round = $precision - floor(log10(abs($value))) - 1;
return round($value, $round);
}
----
Server IP: 66.207.199.35
Probable Submitter: 139.142.65.19
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit -- https://master.php.net/note/edit/87819
Del: integrated -- https://master.php.net/note/delete/87819/integrated
Del: useless -- https://master.php.net/note/delete/87819/useless
Del: bad code -- https://master.php.net/note/delete/87819/bad+code
Del: spam -- https://master.php.net/note/delete/87819/spam
Del: non-english -- https://master.php.net/note/delete/87819/non-english
Del: in docs -- https://master.php.net/note/delete/87819/in+docs
Del: other reasons-- https://master.php.net/note/delete/87819
Reject -- https://master.php.net/note/reject/87819
Search -- https://master.php.net/manage/user-notes.php