SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: round??
-
May 15, 2003, 18:35 #1
round??
how to round up numbers for eg.
5.185 becomes 5.19??
i tried this...
$have_to_pay = round($have_to_pay2, 2);
but i got 59.18 instead of 59.19
-
May 15, 2003, 18:58 #2
- Join Date
- Oct 2001
- Location
- Bay City, Oregon
- Posts
- 715
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Stolen from the PHP docs.
If you want .5 to always round up, add 0.00000001 to the number before rounding.
http://www.php.net/manual/en/function.round.phpLast edited by Herbster; May 15, 2003 at 19:59.
Bookmarks