-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem to get value with "unmasked" when precision is 0 #123
Comments
same issue here |
@atrandafir @pilap82 sorry for taking so long to reply. I will take a look at this in a few days. here's what I'm planning for maskmoney 3.1 https://github.com/plentz/jquery-maskmoney/issues?milestone=6 |
Same issue. I've got a field with value then, when I do |
Hey guys, have their been any update on this situation ? |
@EtienneDepaulis instead jqyery-maskmoney I used RobinHerbots/jquery.inputmask library (for input masking) and leongersen/wnumb for number/money formatting. |
I can at least tell you what the issue is:
solution:
I have mocked some of this up, but the changes are pretty damn extensive. |
Here's the solution I've been working on: Move unmasked label in to init method and add an event binding to get a handle back to it. This was so that the unmask function has access to the settings object. Then I think the solution is to check for minus symbol and the index of the decimal/cents separator. Run the existing \D regex, split, and re-insert decimal symbol and -. (should it replace it with "." or with the specified separator?) In the place of the exiting unmask method, I trigger the unmasked event on the element so that the invocation remains the same. Any thoughts on this? |
I have the same issue here. |
Seeing the same issue, any work-around ideas for getting the correct value? I'm thinking of multiplying by 1,000. |
I believe I resolved this by utilizing jQuery.data() to bind the settings to the element and then reusing them to determine the decimal value. I've added a pull request for this update, #175 |
@NemSavic Your fix works perfectly for me. Thanks |
@NemSavic This is working great. Thank you! |
I have configured it with precision to 0, because I dont want any decimals.
So when I type 555555 it turns into 555.555 €, but when I use "unmasked" it will bring back 555.555 instead of 555555 as it should.
The text was updated successfully, but these errors were encountered: