Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] format number to currency


  • From: javascript@xxxxxxxxxx (Thomas Wheeler)
  • Subject: [Javascript] format number to currency
  • Date: Wed, 30 May 2001 10:17:28 -0700

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 ?=20
I need to be able to do this without knowing how long of a number the user =
will enter. =20

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

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