Nain
Nain

Reputation: 97

robin herbot's inputmask with commas and 2 decimal places

I'm using Robin Herbot's inputmask jquery plugin, and I am getting output as expected but I want it with commas i.e. 12,345.67 and with 2 decimals.

$('#currency').inputmask({'mask':"9{0,10}[.9{0,2}]", greedy: false});

Upvotes: 4

Views: 7952

Answers (1)

Kukic Vladimir
Kukic Vladimir

Reputation: 1010

I have managed to make it working with following code

$('#currency').inputmask({
   'alias':          'decimal',
   'groupSeparator': ',',
   'autoGroup':      true, 
   'digits':         2,
   'digitsOptional': false,
   'placeholder':    '0.00'
});

so the actual output looks like this 12,312,311.00

Hope this helps

Upvotes: 9

Related Questions