Auto Currency | JavaScriptSource

Auto Currency

Mario Costa May 11, 2001


Inserts the proper seperators to automatically format any currency field.

Enter Value:


  • Created by: Mario Costa
  • Posted: May 11, 2001

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: autoCurrency.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Thank u very much ,it's working fine

Manindar Jun 2, 2014

Hi, just wanted to say this code is excellent. I managed to convert it to JQuery so now instead of calling the function I just add a (class = "currency") to any input field and it works beautifully, Much thanks to the author.

gmac Jul 30, 2008

What you need to do to fix this is add the following two lines to the rest of the special characters (under codes 8 and 13):[br /][br /] if (whichCode == 9) return true; // Tab[br /] if (whichCode == 11) return true; // Tab

Brian Jul 17, 2008

You could add it at the beginning, outside of the box, e.g.,[br /] Enter Value: $

Lee Nov 21, 2007

How Can I add the doller signe "$" at the start

yassen Nov 16, 2007