Inputmask
Inputmask copied to clipboard
Unable to retain decimal point in unmasked value
Hi Robin,
love the plugin!
qq on logic for removal of decimal mask.
e.g. I have following mask within document.ready function: $('#myInputField').inputmask("$9,999,999.99", {numericInput: true} );
Input field will display correct mask as set above and e.g. if user enters 3.33 then entered value will be $,__,__3.33.
On a test button click, I want to retrieve unmasked value as 3.33. For that, I coded this to remove the mask within onclick event handler: $('#myInputField').inputmask('remove');
My issue is, upon removal of input mask, value results to be 333. I lost decimal point (but I want to be able to get value as 3.33. i.e. retain decimal point).
I see pointers to use onunmask function. I will try that out and post the update if successful. In the mean time, if you can provide any guidance, will appreciate the help. Thanks!
@mnrfeb19 ,
The onunmask provides you with the maskedvalue and unmaskedvalue. You can manipulate the output to suite you needs.
If i write
Inputmask.unmask("1.24", { mask : "[9]9.99", radixPoint : ".", groupSeparator : ",", })
the result is 124 , removing the decimal dot.
Is this a bug?