note 6180 deleted from function.round by jeroen
| From: | jeroen@php.net | Date: | Sat, 01 Sep 2001 12:40:21 +0000 |
| Subject: | note 6180 deleted from function.round by jeroen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17501@lists.php.net to get a copy of this message | ||
Another way to print a float to 2 decimal points of precision is to use the number_format() function
(instead of printf or dividing/multiplying by 100). For example: <pre>$cost =
2100.5666;</pre><br><pre>echo number_format($cost, 2);</pre>--Returns the
string "2,100.56".