display comma in integer

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tkarven
Forum Commoner
Posts: 41
Joined: Tue Aug 02, 2005 10:26 pm

display comma in integer

Post by tkarven »

hi,

how can we display the comma for currency(integer) ?

e.g. 1,000,000 instead of 1000000

thx
User avatar
harrisonad
Forum Contributor
Posts: 288
Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:

Post by harrisonad »

string number_format ( float number [, int decimals [, string dec_point, string thousands_sep]] )
The fourth arguements take any character to be displayed for thousands group
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

default behaviour for number_format is a comma seperator for thousands and dot for the decimal.
tkarven
Forum Commoner
Posts: 41
Joined: Tue Aug 02, 2005 10:26 pm

Post by tkarven »

thanks so much , i got it
Post Reply