Re: Format of Print

From: Date: Wed, 13 Dec 2000 18:30:49 +0000
Subject: Re: Format of Print
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5216@lists.php.net to get a copy of this message
It's quite simple, you just use the numberformat function: print '$'.numberformat($VehInventory->MarketValue,2); so it outputs a $ followed by the number formatted with 2 decimal places. This uses the , and . as the default separators, and you can read more about it here: http://www.php.net/manual/function.number-format.php Matthew At 11:50 AM 12/13/2000 -0600, you wrote:
I have a question regarding formatting a number field to print as currency using the print command. Now, my print command reads; print $VehInventory->MarketValue VehInventory is the table name MarketValue is a 10 digit, numeric field which now displays 25000 and I want $25,000 Can you help? Thanks -- 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


« previous php.db (#5216) next »