customd / jquery-number

Easily format numbers for display use. Replace numbers inline in a document, or return a formatted number for other uses.
https://www.customd.com/articles/14/jquery-number-format-redux
MIT License
442 stars 402 forks source link

Fix for non-US separators bug #119

Open stevevg opened 8 years ago

stevevg commented 8 years ago

On customd@a502e75a0928b56872c58b37140dce4a5c532a78 version, if I set a different thousands separator than "," and insert a number > 1000, then delete a decimal number, the input field is reset.

For example, if I set decimal separator: , (comma) thousands separator: . (dot) and type 1.234,56

If I try to delete the number 5 (both with backspace or delete key), the input field is reset.

This commit fixes this bug.

Moreover, I added the numpad "." as a decimal separator, even if "." is not the decimal separator (credits for this go to ToX82@333e19c386e69d3b8475f08a48daa1e838a2301a)