Re: converting whole or tenth prices to double decimal
| From: | Brian A. Anderson | Date: | Thu, 23 Dec 2004 12:35:56 +0000 |
| Subject: | Re: converting whole or tenth prices to double decimal | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205073@lists.php.net to get a copy of this message | ||
I found it....
$strprice1 = number_format($strprice1, 2, '.', '');
----- Original Message -----
From: "Brian A. Anderson" <listread@arielpremium.com>
To: <php-general@lists.php.net>
Sent: Thursday, December 23, 2004 6:25 AM
Subject: [PHP] converting whole or tenth prices to double decimal
> Anybody know the easiest way to convert a number like 2.1 to $2.10 or 2 to
> $2.00?
>
> Silly question?
>
> -Brian
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>