jQuery number seperator - Seperate number by each 1.000

Posted by Kim Andersen on Stack Overflow See other posts from Stack Overflow or by Kim Andersen
Published on 2010-05-19T06:29:47Z Indexed on 2010/05/19 6:40 UTC
Read the original article Hit count: 600

Filed under:
|
|
|

Hi

I'm developing a new site, and in here it's possible for the user to type in a price in a input-textfield. So what I need is some jQuery-code to transforn the typed in price. This means, that when a user types in "1000", the vissible text in the input field shall automatically be transformed to "1.000" - with a period. And if they type in "10000" it should be transformed to "10.000" etc. You can see a live example on this website I found: http://www.boligsiden.dk/ I know it's on danish, but on the frontpage under the map, there are to input fields. One of them is saying "Minimum kontaktpris". You can try to type in a number in here, and see the effect that I'm looking for.

Does anybody know how I can achieve this? Either by a jQuery plugin, or by some "homemade"-code?

Thanks in advance.

/Kim Andersen

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about number