Currency Format | JavaScriptSource

Currency Format

JavaScriptSource Staff Sep 9, 2000
This script accepts a number or string and formats it like U.S. currency. Adds the dollar sign, rounds to two places past the decimal, adds place holding zeros, and commas where appropriate. Occurs when the user clicks the button or when they finish entering the money amount (and click into the next field).
Enter a number then click the button:

or enter a number and click another field:

The JavaScript Source: Forms: Currency Format

Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!


Did you use this script?  Do you like this site?  Please link to us!

Leave a Response

1 comment)

Really old script and doesn't work in FireFox

Gonzo Far Dec 18, 2012