Page 1 of 1

Putting commas in correct places on a number

Posted: Fri Mar 10, 2006 11:12 am
by djwk
Hey I'm looking for something simple to display a number with commas seperating millions, billions, hundred thousands etc.

So lets say I had:

Code: Select all

1248290
I want it to display

Code: Select all

1,248,290
or

Code: Select all

24920391394
to

Code: Select all

24,920,391,394

I don't want to have to change how long the number is, like when its a billion i dont want to have to specify that its at a billion. I hope this explains what I want the script to do.

Can anyone help out?

Posted: Fri Mar 10, 2006 11:15 am
by feyd

Posted: Fri Mar 10, 2006 12:15 pm
by djwk
Thanks, works a charm :)