Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2000121

Re: [PHP-DB] Format of Print From: Matthew Ballard (Matthew <email protected>)
Date: 12/13/00

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 <email protected>
>For additional commands, e-mail: php-db-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>