Re: typecasting .. easy?

From: Date: Thu, 19 Jun 2003 11:46:35 +0000
Subject: Re: typecasting .. easy?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152144@lists.php.net to get a copy of this message
Hi Roy, > 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" Have a look at the number_format() function, it should do what you want. It'll also add commas to break up any thousands in your number (you can bypass that if you like). Cheers Jon

« previous php.general (#152144) next »