How to mask optionally negative number?
See original GitHub issueHi,
How do I create a mask for optionally negative number? I have tried mask="-?0*.99"
but it doesn’t allow to enter anything after the -
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
ngx-mask to accept negative numbers - angular - Stack Overflow
After delving into the ngx-mask code: There is either missing documentation or a bug that requires the optional character '?' in the mask...
Read more >Allow negative numbers when using currency input mask
Put a currency input mask on a textfield, put a negative value in it, and try to submit the webform. You will not...
Read more >Control data entry formats with input masks - Microsoft Support
The third part of the input mask is also optional and indicates a single ... Any positive or negative number, no more than...
Read more >ASPxTextBox - How to create a mask for negative currency ...
Hi, I've created a mask for ASPxTextBox to allow users to copy and paste currency values from Excel. The idea is to accept...
Read more >Custom Input Masks (Numeric/Integer) - Informa Software
The mask can contain two parts delimited by the ';' character. The first part defines the mask for entering positive values; the second...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
for me this work <input type=“text”
mask=“separator.2” [allowNegativeNumbers]=“true” thousandSeparator=“.” separatorLimit=“100000” formControlName=“amount” />
Note: ngx-mask version 10.0.4 Angular 10+
This seems to work:
customPatterns = { '0': { pattern: new RegExp('-|[0-9]') }, '9': { pattern: new RegExp('[0-9]') } };
<input mask="09*.99" [patterns]="customPatterns" [dropSpecialCharacters]="false">