Re: typecasting .. easy?
| From: | Awlad Hussain | Date: | Thu, 19 Jun 2003 11:53:04 +0000 |
| Subject: | Re: typecasting .. easy? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152146@lists.php.net to get a copy of this message | ||
try
$formatted = number_format($amount,2);
----- Original Message -----
From: "Roy W" <php@wiegmann.net>
To: <php-general@lists.php.net>
Sent: Thursday, June 19, 2003 12:41 PM
Subject: [PHP] typecasting .. easy?
> $amount is a calculated number
>
> If $amount equals for example 52., how do I get that to print as "52.00"
> similarly, if amount = 52.5 how do I get that to print as "52.50"
>
> Thanks!
> (looked at all sort of type casting manual stuff to no avail)
>