Re: Formatting Numbers

From: Date: Thu, 14 Sep 2000 17:09:28 +0000
Subject: Re: Formatting Numbers
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-2891@lists.php.net to get a copy of this message
Try number_format $total=123456789.12345; $total="$".number_format($total, 2,'.',','); $total will be a string formated as '$123,456,789.12' see also: http://www.php.net/manual/function.number-format.php Manuel wrote: > > Hi, > > 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. > > Please advice. > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- ************************************************************************ * Fear is the path to the darkside... * * Fear leads to anger, anger leads to hate, hate leads to suffering...* * Suffering is caused by Microsoft... * ************************************************************************ * Joe Lloyd joe@soundprint.org http://www.soundprint.org * * Online Manager System Administrator Web Designer * ************************************************************************

« previous php.db (#2891) next »