RE: [PHP] Concerning number_format()
| From: | Ed Curtis | Date: | Thu, 06 Nov 2003 14:39:57 +0000 |
| Subject: | RE: [PHP] Concerning number_format() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168726@lists.php.net to get a copy of this message | ||
Duh. Yeah, works like a charm.
Thanks,
Ed
On Thu, 6 Nov 2003, Jay Blanchard wrote:
> [snip]
> $price = "1234.567890";
>
> $price = number_format($price, 2, '.', '');
>
> echo $price;
>
> Returns 1234.567890
>
> Should return 1234.57 correct?
> [/snip]
>
> Use a new variable to hold the modified information
>
> $price = "1234.567890";
>
> $newPrice = number_format($price, 2, '.', '');
>
> echo $newPrice;
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>