Page 1 of 1

printf help

Posted: Wed Nov 01, 2006 2:26 pm
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

Posted: Wed Nov 01, 2006 2:28 pm
by Luke
have you looked at number_format()?

Posted: Wed Nov 01, 2006 2:51 pm
by warrenk
Didn't know that the number_format() existed.

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