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

Cant get the money mask to work #762

Open
whitsey opened this issue Dec 14, 2020 · 2 comments
Open

Cant get the money mask to work #762

whitsey opened this issue Dec 14, 2020 · 2 comments

Comments

@whitsey
Copy link

whitsey commented Dec 14, 2020

I am getting irregular results and I am not sure if it is me or the plugin

I have a value: 2520000

I apply a mask: $('.amount_total').mask('$##,###,###');
and: $('.amount_total').mask('$##,###,###.##');

Result: $25,200,00

I also tried: $('.amount_total').mask('$#,###');
and: $('.amount_total').mask('$#,###.##');

Result: $2,5200,00
and: $2,520.000

I also tried: $('.amount_total').mask('$000,000,000');
and: $('.amount_total').mask('$000,000,000.00');

Result: $252,000,0

What am I doing wrong?

@CAVAh
Copy link

CAVAh commented Jan 6, 2021

The problem is you should use {reverse: true} option. And using $ get some problems or anothers issues.

If you want a float number you should use this mask:
$('.amount_total').mask("#.##0,00", {reverse: true});

@ftcastro
Copy link

Hello! I have a similar problem.

Tried to use both masks:

$('.mask-value').mask("#.##0,00", {reverse: true});
$('.mask-value').mask('000.000.000.000.000,00', {reverse: true});

to make my currency field work. But when I type the values, if it's a value like 10.000,00 ir generates only 1,00000000.

And if it's a value with several numbers, like 19.952,25 it shows only 199,52. And if I keep typing, it resets the value. Also, it does not accept the character "0".

Best regards,
Fernando.

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

3 participants