RE: [PHP-DB] Formatting Numbers

From: Date: Thu, 14 Sep 2000 17:16:09 +0000
Subject: RE: [PHP-DB] Formatting Numbers
Groups: php.db 
Request: Send a blank email to php-db+get-2890@lists.php.net to get a copy of this message
> I am looking for a simple solution for MySQL and PHP4.0.1pl2. > How do I format my numeric output fields from 1234.50 to $1,234.50? > I search the MySQL manual for it but did not manage to find > anything except for the format(numeric,decimal) function. > I do not know how to implement it. <? $var = "1234.567890"; $var = "$" . number_format( $var, 2 ); echo "$var<br>"; ?> Output will be: $1,234 Chris

« previous php.db (#2890) next »