Cleave.js: Allow user to type in both "," and "." as decimal mark

Created on 24 Jul 2019  路  2Comments  路  Source: nosir/cleave.js

For formatting numerals and setting the decimal mark to ",", I would like the user to be able to use "." too as being recognized as the decimal mark and get converted automatically to ",".

Is this currently possible? Or via another way?

I am currently using this library in Vue, and I am not able to replace this as the user types, as the used Cleave component doesn't allow me to replace the 'other' decimal mark to the 'real' one myself.

Most helpful comment

Found this as a similiar issue ,
In my country the preferred decimal separator is , and thousand delimiter .. I successfully setup cleave.js to format input this way and its been nice straightforward experience.

However, some users are confused (probably because they use different keyboard layout) that pressing . doesn't produce decimal separator. I would like to configure cleave to accept both . and , as keys registered for inserting decimal separator, while keeping the desired formatting.

All 2 comments

This is something I am also really looking forward to. I think an extra option allowing to set an array of alternative decimal separators would be great. I have seen such a mechanism implemented in a lot of banks and other financial institutions.

Also, this seems to be a duplicate of #405 and #404

Found this as a similiar issue ,
In my country the preferred decimal separator is , and thousand delimiter .. I successfully setup cleave.js to format input this way and its been nice straightforward experience.

However, some users are confused (probably because they use different keyboard layout) that pressing . doesn't produce decimal separator. I would like to configure cleave to accept both . and , as keys registered for inserting decimal separator, while keeping the desired formatting.

Was this page helpful?
0 / 5 - 0 ratings