Possible Duplicate:
Place commas in Javascript integers
I have a variable containing a number in JavaScript and I want to display it with commas in all the right places. So, for 222222 I need 222,222 and for 1000333 I need 1,000,333. What’s the simplest way to do this?
Try this:
Example fiddle