ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Mask percentage not work correctly

Open thangnguyen5201 opened this issue 5 years ago • 1 comments

In version 10.0.1 I can't use mask="percent.2" to mask percent. This is my input field: <input matInput placeholder="Cash Discount" formControlName="cashDiscount" mask="percent.2" suffix="%" [dropSpecialCharacters]="false" /> It throw an error when I input something, and I also can't get this input value in type number. Anyone can help???

thangnguyen5201 avatar Sep 14 '20 04:09 thangnguyen5201

I faced a similar problem. When I use the "percent" mask everything works fine. But if I try to add a mask with a sign after the comma ("percent.0", "percent.1", "percent.2" etc.), then the input is always invalid.

oleksandr-kupenko avatar Oct 07 '21 18:10 oleksandr-kupenko

@oleksandr-kupenko @thangnguyen5201 Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-7gcplg?file=src%2Fmain.ts

andriikamaldinov1 avatar Jun 15 '23 12:06 andriikamaldinov1