Is there a built in function of JavaScript to convert a string into a currency format?
For example
var a = \'1234\';
a.convertToCurrency(); // retu
Seems like a lot of work to just parse out a string and figure out where to put the commas.
Here's a little script I put together this morning that will do the trick for whole numbers:
Call the function numberToCurrency and pass your value as (amount), and it will put the commas where they should be.
Number to Money Conversion