note 42082 added to function.money-format
| From: | matt_at_casslin_dot_com at rn2 dot php dot net | Date: | Mon, 03 May 2004 03:30:10 +0000 |
| Subject: | note 42082 added to function.money-format | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69121@lists.php.net to get a copy of this message | ||
I'm running a windows server and this feature won't work... but here's a function I
made for displaying values with 2 number after the decimal point (i.e. 1245.12, 3.01 or 2.00)...
function format_money($VALUE){
if (strrchr($VALUE,".")==FALSE){ $VALUE="".$VALUE.".00"; }
$DECIMAL_POINT_POSITION = strrpos($VALUE,".")+1;
$AFTER_DECIMAL_POINT = substr($VALUE,$DECIMAL_POINT_POSITION,2);
if(strlen($AFTER_DECIMAL_POINT)=="1"){ $VALUE = "".$VALUE."0"; }
if(strlen($AFTER_DECIMAL_POINT)=="0"){ $VALUE = "".$VALUE."00"; }
return $VALUE;
----
Manual Page -- http://www.php.net/manual/en/function.money-format.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42082
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42082&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42082&report=yes
Search -- http://master.php.net/manage/user-notes.php