Possible Duplicate:
How can I format numbers as money in JavaScript?
The input string is any number which may or may not have decimal places, and we have to
place commas in appropriate places in the currency number. For example-
input - 1000 output - 1,000
input - 1000.00 output - 1,000.00
input - 1200000 output - 1,200,000
(the comma(,) separator appears after every 3 digits, ignoring decimal places).
Can we do this total work only through regular expression in javascript?
Kindly guide.