Re: Formatting/Financial
| From: | Andrew Golovin | Date: | Thu, 01 Feb 2001 06:48:35 +0000 |
| Subject: | Re: Formatting/Financial | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-37607@lists.php.net to get a copy of this message | ||
Hello, [!
Thursday, February 01, 2001, 06:33:53, you wrote:
r> Is there a simple way to format a variable into an appropriate financial
r> string...
r> I'd like all of the above to format as $XXX.XX
try to use
$value = 5.0;
$sval = sprintf("$%003.2f",$value);
$sval will contain formatted value.
Best regards!
Andrew Golovin
PGP Fingertip 24FD A0CD 667C 1FC7 C2F7 A2EA 9742 D484 FD3C 598D
http://exper.ural.ru/