RobinHerbots / Inputmask

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

Decimal separator conversion on seting a value #2077

Open spacedog4 opened 5 years ago

spacedog4 commented 5 years ago

Like the #919 issue, if I have the radixPoint setted to "," I can type 550.50 that it will convert to 550,50 but if I set the value in jQuery like this jQueryElement.val(550.50) it writes 5.505 instead of 550,50

RobinHerbots commented 5 years ago

Which version do you use of thé inputmask!?

spacedog4 commented 5 years ago

Version: 4.0.6

PashaStets1 commented 5 years ago

I was using Version: 3.3.7-12, and everything works fine. But then I update library to latest version and I faced with the same issue as "spacedog4". What is the status?

My code for musk is next: $(ElementID).inputmask({ alias: "numeric", radixPoint: ",", groupSeparator: ".", autoGroup: true, digits: 2, digitsOptional: true, placeholder: "0", autoUnmask: true });

PashaStets1 commented 5 years ago

As a temporary solution i add this: onBeforeMask: function (value) { var processedValue = value.replace(".", ","); return processedValue; } and everything works fine. At least for me. @spacedog4 just for your information.