[Custom Input Masks] DecimalDigits set to 0 in CurrencyMask ends up with 2 digits anyway

Forge Component
Published on 2019-04-22 by Marcelo Ferreira
43 votes
Published on 2019-04-22 by Marcelo Ferreira

I am not sure this is a bug or a feature, but when we use 0 for the property DecimalDigits in a MaskCurrency we end up with 2 digits anyway. I looked at the javascript for currency and it says this:

if (decimalDigits != 0) {
        maskOpts = $.extend(maskOpts, {
                digits: decimalDigits

I tried setting my locale options to 0 digits but it's not listening to locale settings either when no digits option is provided in maskOpts.

My hack is the following: I set the DecimalDigits option to -1, this way the if branch is entered and the setting is applied. 

The result is 0 digits in my mask!

I have the newest version of CustmInputMask and I have the same promlem as Wendy Tromp.

I put in 0 decimalDigits but still I end up with two zeros as decimal digits.

The -1 hack is not working for me because I have a Suffix and that ends up adding four zeros to every number I write.