admin管理员组

文章数量:1353261

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

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

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

$('#currency').inputmask({'mask':"9{0,10}[.9{0,2}]", greedy: false});
Share Improve this question edited Dec 6, 2022 at 16:48 sergiol 4,3455 gold badges49 silver badges88 bronze badges asked Jul 12, 2017 at 20:58 NainNain 973 silver badges11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

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

本文标签: javascriptrobin herbot39s inputmask with commas and 2 decimal placesStack Overflow