Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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});
like image 208
Nain Avatar asked Oct 15 '25 16:10

Nain


1 Answers

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

like image 163
Kukic Vladimir Avatar answered Oct 18 '25 05:10

Kukic Vladimir