Good afternoon, everybody, there is a need to create a mask for entering money.
For the money entry field I use the jQuery-Mask-Plugin plugin . For example, there is a sum of 50,000, when typing in the field according to the mask rules $('.money').mask('000 000 000 000 000', {reverse: true}); it turns out 50,000 which is correct, but sometimes you need to enter a point, and then there is a difficulty. Need help building a pattern.
I tried to do this:
$('.money').mask('ZZZXZZZXZZZXZZZ', { translation: { 'Z': { pattern: /\d/, reverse: true }, 'X': { pattern: /\s|\./, reverse: true } } }); But this is not a solution, since the space should always be entered manually. And this rule is for a 3-digit number, that is, 2.5 is not written. It should also be borne in mind that no space should be automatically inserted after the full stop. You can even use any custom solution.