RobinHerbots / Inputmask

Input Mask plugin
https://robinherbots.github.io/Inputmask/
MIT License
6.39k stars 2.17k forks source link

Problem with decimal digits combined with radixPoint and groupSeparator #1655

Open borzaka opened 7 years ago

borzaka commented 7 years ago

I have extended the decimal alias like this:

Inputmask.extendAliases({
    'decimal': {
        radixPoint: ',',
        digits: 2,
        autoGroup: true,
        groupSeparator: " ",
        autoUnmask: true
    }
});
$('.decimal').inputmask("decimal");

If I load the input with a 313.038 value, the result will be 313 038 instead of 313,04

<input type="text" class="decimal" value="313.038" />

But if I load the input with 313,038, the result is good: 313,04

<input type="text" class="decimal" value="313,038" />

I expect that it should work with booth . and ,, because it works if I type this numbers to the input booth ways.

JS Bin test case

Update: If I add one more number to the end, for example 313.0381, than it works fine: it gives me 313,04

fraserredmond commented 6 years ago

Same thing happens to me.

IMalaniak commented 5 years ago

Hi there, I've got the same problem with "digits: 3"