php-db | 2000121
Date: 12/13/00
- Next message: Mon Akira: "[PHP-DB] dbase_ commands dont work"
- Previous message: Test1: "[PHP-DB] interbase -901 - feature not supported / connect string problem?"
- In reply to: Jeff Moss: "[PHP-DB] Format of Print"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Mon Akira: "[PHP-DB] dbase_ commands dont work"
- Previous message: Test1: "[PHP-DB] interbase -901 - feature not supported / connect string problem?"
- In reply to: Jeff Moss: "[PHP-DB] Format of Print"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

