RobinHerbots / Inputmask

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

autoGroup issue with numericInput: true #1341

Open srinavakiran opened 8 years ago

srinavakiran commented 8 years ago

I am using inputmask with angular. It is working good. But when there is value in textbox on load like 975635.50 is converting into $ 597,635.50. Here is my sample. I need to use numericInput to place the caret at the end. Without that is it is working fine. But when i use numericInput and autoGroup, then i am facing issue.

$("#good").inputmask("numeric", { radixPoint: ".", digits:2, numericInput: true, autoGroup: true, groupSeparator: ",", groupSize: 3, rightAlign: true, placeholder: "0", prefix: '$ ',autoUnmask: true, onBeforeMask: function (value, opts) { console.log(value); if(value.indexOf(".")>-1) { var items= value.split("."); if( items[0].length != 2) { items[0]= "0"+items[0]; } } console.log(items[0]+items[1]); return items[0]+items[1]; }});

srinavakiran commented 8 years ago

Any luck?