When I use mask="delimiter.2" and delimiter="." default shows with comma. Angular 13
See original GitHub issueπ bug report
Description
I used a mask like this:
<input autocomplete="off" type="text" decimalMarker="." mask="separator.2">
add data via reactive forms:
formControl.setValue(400.25);
π₯ Exception or Error
shows like this:
400.25 -> 400,2
255.43 -> 255,4
Also write text after the number will remove those numbers
π Your Environment
Angular Version:
"@angular/core": "^13.3.7",
"@angular/forms": "^13.3.7",
"ngx-mask": "^13.1.14",
Everything works fine in this version.
βngx-maskβ: β^12.0.0β
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Using comma as a list separator in Angular 2 - Stack Overflow
I like Eric's answer better (see his comment for a sample Plunker): <span *ngFor="let item of items; let isLast=last"> {{item}}{{isLast ?
Read more >JS Daddy ngx-mask Issues - Giters
JS Daddy ngx-mask: Angular Plugin to make masks on form fields and html ... When I use mask="delimiter.2" and delimiter="." default shows with...
Read more >Decimal Pipe Comma Separator Example Arg - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >Adding An ngRepeat List Delimiter In AngularJS
This Span tag took care of conditionally showing a list delimiter based ... delimiter is a dash, rather than the more commonly-used, "comma....
Read more >How to Convert Comma Separated String to Array in Angular?
Here, i will show you how to works how to convert array into comma separated string in angular. you will learn convert string...
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
Hello,
Same report here with βseparatorβ, the following use case worked in v12 but fails in v13 & v14
When userβs browser language is in βfrβ And angular component has
public value = 1234.56;
And angular template has :Then browser should display:
but since v13, the input value in browser is
1 234,56
. The pipe is still OK.Itβs maybe due to https://github.com/JsDaddy/ngx-mask/blob/develop/projects/ngx-mask-lib/src/lib/mask.service.ts#L246 since in those browser
Number(1234.56).toLocaleString('fullwide', {useGrouping: false, maximumFractionDigits: 20, })
returns"1234,56"
Should βfullwideβ could be replaced by βen-USβ instead, since
Number(1234.56).toLocaleString('en-US', {useGrouping: false, maximumFractionDigits: 20, })
returns"1234.56"
?this fix might help, this was committed after the upgrade to angular 14
could someone please try to release a patch for angular 13 version?
UPDATE: commit doesnβt help