JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.16k stars 300 forks source link

Struggling with relatively simple mask #1253

Closed varadero closed 1 year ago

varadero commented 1 year ago

My ngx-mask version is 16.3.9 and I want to achieve the following:

I have tried what not but without full success.

For example I tried with mask="00.00||00.0||0.00||0.0||00||0" hoping that this will allow:

If I apply such mask, then if I type "1.23" the value in the input field becomes "12.3".

Any ideas how can I achieve the "1 or 2 digit integer or 1 or 2 digits before and after the decimal separator" type of mask ?

andriikamaldinov1 commented 1 year ago

@varadero Thanks for using Ngx-Mask. For ur case please use mask="09.09" It example all work as expected - https://stackblitz.com/edit/angular-egcqzy?file=src%2Fmain.ts,src%2Fglobal_styles.css