Thursday, 27 August 2020

ngx-mask Do not allow negative value for the currency input

I need to block the type of negative value and do not allow to type more numbers than 99,999,999.99 for my input.

Here is the code which I am using for the currency input.

<input mask="separator.2" thousandSeparator="," placeholder="Currency">

Any help will be appreciated.

Also here is the Stackblitz example.

https://stackblitz.com/edit/ngx-mask-currency-input?file=src/app/app.component.html

UPDATE

I found the answer to the second part of my question. now the input looks like this

<input mask="separator.2" thousandSeparator="," separatorLimit="10000000"  placeholder="Currency">

Now just needs to be blocked the type of - character



from ngx-mask Do not allow negative value for the currency input

No comments:

Post a Comment