RobinHerbots / Inputmask

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

Hide decimal values in mask for alias currency #2339

Open deepseacode10 opened 4 years ago

deepseacode10 commented 4 years ago

Right now the input mask for currency shows "$0.00" on an empty input, is there a way to change this so that it only shows "$0" and not the ".00" on the end for the currency alias?

RobinHerbots commented 4 years ago

Hi @deepseacode10 ,

You can add the digitsOptional option.

Inputmask("currency", {
            prefix: "$ ",
            digitsOptional: true
        }).mask("test1");