Wardhana Wardhana - 1 month ago 12
Javascript Question

How to change format decimal using jquery mask input?

I am using Jquery input mask. I have a problem to change decimal format number. If I using

$(selector).inputmask({ 'alias': 'decimal', 'groupSeparator': '.', 'autoGroup': true, 'rightAlign': false });
the decimal result is
10,000.00
. How to change to format
10.000,00
?

Answer

You can set the radixPoint to , and groupSeparator to ..

$(selector).inputmask({
    'alias': 'decimal',
    'radixPoint': ',',
    'groupSeparator': '.',
    'autoGroup': true,
    'rightAlign': false,
    'numericInput': true
});

Please also check this example: http://codepen.io/rooyva/pen/1f20a3883258d306b5098f03ab30517f/

Comments