In my web application I have an input field called "Budget" where users enter the proposed budget for a project. I need to create a masked input to automatically bring the entered amount to the following format while the user is typing into the input field:
1 000
10 000
100 000
I've searched throughout the Internet but don't seem to find the necessary one. Could anybody point me to a suitable plugin or maybe suggest a custom solution?
Thanks in advance.
Simple Solution using Only Javascript.
I use the following code to archieve currency format without use of additional plugins:
JSFiddle: https://jsfiddle.net/gt2Ly5rt/6/
With this script, the user will enter only numbers, the script will automatically place decimal and thousands separators (it is hardcoded to BRL format, but you can customize it).
For instance, if user types:
Hope it helps someone.
Try any of these:
http://plugins.jquery.com/tag/currency/
These may also contain what you're looking for:
http://plugins.jquery.com/tag/mask/
I use this one (http://code.google.com/p/jquery-formatcurrency/) in my production site and not had any issues with it and the api is simple enough.