printf help

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
warrenk
Forum Newbie
Posts: 13
Joined: Wed Nov 01, 2006 8:46 am

printf help

Post by warrenk »

I am using the following statement to output a number....

printf("%6.2f\n",$total);

Is there anyway to add a ',' for the thousands separator?

Thanks!
Warren
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

have you looked at number_format()?
warrenk
Forum Newbie
Posts: 13
Joined: Wed Nov 01, 2006 8:46 am

Post by warrenk »

Didn't know that the number_format() existed.

Tried it and it works....thanks for your help!
Post Reply