Adding Commas to Numeric Entries

This JavaScript adds commas in the proper places. The script was originally developed to convert data in the format nnnn, nnnn., or nnnn.nn into a proper currency (US) amount, so it also adds a dollar sign to the front.

Enter a number to convert:
Here is the converted number: