note 78314 added to function.number-format

From: Date: Sat, 06 Oct 2007 09:34:45 +0000
Subject: note 78314 added to function.number-format
Groups: php.notes 
Request: Send a blank email to php-notes+get-131166@lists.php.net to get a copy of this message
A simple funtion to format american dollars. <? function formatMoney($money) { if($money<1) { $money='&cent;'.$money*100; } else { $dollars=intval($money); $cents=$money-$dollars; $cents=$cents*100; $money='$'.$dollars.' and &cent;'.$cents; } return $money; } echo formatmoney('52.342'); ?> This will output: " $52 and ¢34.2 ". ---- Server IP: 69.147.83.197 Probable Submitter: 86.126.254.53 ---- Manual Page -- http://www.php.net/manual/en/function.number-format.php Edit -- https://master.php.net/note/edit/78314 Del: integrated -- https://master.php.net/note/delete/78314/integrated Del: useless -- https://master.php.net/note/delete/78314/useless Del: bad code -- https://master.php.net/note/delete/78314/bad+code Del: spam -- https://master.php.net/note/delete/78314/spam Del: non-english -- https://master.php.net/note/delete/78314/non-english Del: in docs -- https://master.php.net/note/delete/78314/in+docs Del: other reasons-- https://master.php.net/note/delete/78314 Reject -- https://master.php.net/note/reject/78314 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#131166) next »