5

For my project I'm using jQuery-Mask-Plugin. On the site of this plugin there is an example for currency / money.

$('.money').mask('000.000.000.000.000,00', {reverse: true});
$('.money2').mask("#.##0,00", {reverse: true, maxlength: false});

This is not exactly what I'm after, because I want the ,00 be optional in the mask.
Can this be done?

Assertions:

input   | output
________|___________
1111    | 1.111
2222222 | 2.222.222
12,34   | 12,34
1234,56 | 1.234,56

fiddle

A1rPun
  • 16,287
  • 7
  • 57
  • 90

0 Answers0