note 33459 added to function.round
| From: | millerni at msoe dot edu | Date: | Thu, 26 Jun 2003 17:03:33 +0000 |
| Subject: | note 33459 added to function.round | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51050@lists.php.net to get a copy of this message | ||
To simply output US Currency:
function currency($num) {
$num = "\$".number_format($num,2,'.',',');
return $num;
}
// if you call 'currency(82928.28892);'
// this will return '$82,928.29'
----
Manual Page -- http://www.php.net/manual/en/function.round.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33459
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33459&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33459&report=yes