Page 1 of 1

Adding a Comma

Posted: Wed Jun 14, 2006 12:22 pm
by azwebdiva
I have a number i need to format with a comma. For example:
$120,450.00 is what i would want. The code I have found does
not give me that choice.

What I have found is this:

$total_principal = number_format($loan_amount, 2, '.', ' ');


which gives me:
$149 133.37

How can I add a comma with large money amounts?

Your help is greatly appreciated.

JT[/b]

Posted: Wed Jun 14, 2006 12:52 pm
by pickle
The third argument is the thousands separator. Put a comma there instead of a space.