Skip to content
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

unmasking value incorrect #248

Open
ghost opened this issue Apr 13, 2018 · 2 comments
Open

unmasking value incorrect #248

ghost opened this issue Apr 13, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2018

THIS:
"<script type="text/javascript">$("#x_B_Offer_Price").maskMoney({thousands:',', decimal:'.', precision: 0, allowZero: true, allowNegative:false, prefix: ' $'});</script>";

example: $900,000 input

when unmasked:
var num = $('#x_B_Offer_Price').maskMoney('unmasked')[0]; alert('type: '+ typeof(num) + ', value: ' + num)

results in: 900 NOT 900000

@RNAPolymerase
Copy link

RNAPolymerase commented Jun 18, 2018

This is an important issue .. perhaps the most important. I am running into this as well. The problem occurs when there is no decimal point included in the source number. This occurs regardless of whether or not a decimal character has been set up in initialization.

Please see my codesandbox for a working example of the issue: https://codesandbox.io/s/rlq0r8jwwn

@arthur5005
Copy link

Yeah this is some wonky behaviour. Completely unexpected. If the precision is zero, the unmasked output should an integer, always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants