[Javascript] format number to currency

Thomas Wheeler Tomw at c-techindustries.com
Wed May 30 12:17:28 CDT 2001


I'm sure someone out there has done this before..
How can I format a number (or string)  to have commas every three digits..  ie: change 1234567 into 1,234,567 ? 
I need to be able to do this without knowing how long of a number the user will enter.  

 I've played around with string.split() and string.length(), and string.substr().  But I can't get it.  You must have to load the string.length into an array?  

Tom Wheeler
Web Manager 
http://www.c-techindustries.com






More information about the Javascript mailing list