RE: [PHP] converting whole or tenth prices to double decimal
| From: | Robinson, Matthew | Date: | Thu, 23 Dec 2004 12:43:26 +0000 |
| Subject: | RE: [PHP] converting whole or tenth prices to double decimal | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-205069@lists.php.net to get a copy of this message | ||
sprintf should also meet your needs although not as well as
money_format()
-----Original Message-----
From: Richard Davey [mailto:rich@launchcode.co.uk]
Sent: 23 December 2004 12:31
To: php-general@lists.php.net
Subject: Re: [PHP] converting whole or tenth prices to double decimal
Hello Brian,
Thursday, December 23, 2004, 12:25:23 PM, you wrote:
BAA> Anybody know the easiest way to convert a number like 2.1 to $2.10
BAA> or 2 to $2.00?
Use the money_format() function.
(Yes, PHP really does have a solution for nearly everything!)
Best regards,
Richard Davey
________________________________________________________________________
This message has been checked for all known viruses by the
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it
___