Re: Money formatting
| From: | Andrew Brampton | Date: | Tue, 06 Aug 2002 18:41:04 +0000 |
| Subject: | Re: Money formatting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111414@lists.php.net to get a copy of this message | ||
Divide by 100 and place a $ infront of it?
$cents = 1550;
$dollars = $cents / 100;
echo '$' . $dollars;
Andrew
----- Original Message -----
From: "Dan McCullough" <McWC@rocketmail.com>
To: "PHP General List" <php-general@lists.php.net>
Sent: Tuesday, August 06, 2002 5:55 PM
Subject: [PHP] Money formatting
> I need to format numbers to look like dollars and cents.
> So if I have 1550 it needs to look like $15.50 if I have 50 then it needs
to look like $.50
> Any thoughts.
>
> =====
> --------------------------------------------------------
> "Theres no such thing as a problem unless the servers are on fire!"
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>