ngx-mask
ngx-mask copied to clipboard
When I use the mask="separator.2" and thousand Separator="." with an input inside accordion component the comma character disappear
I use the package ngx-mask version: 8.14 and @ng-bootstrap/ng-bootstrap version: 4.0.0
I have an input component using mask inside in the accordion:
<input class="form-control col-xl-8 col-lg-8 col-md-8" id="input-initialValue" name="initialValue" type="text" [(ngModel)]="initialValue" mask="separator.2" thousandSeparator="." separatorLimit="9999999999999999" (focus)="selectAllContent($event)" />
When I click on accordion, and my input has the initial value of "5,25", it expands and then when I click again, the comma disappears and the value becomes: "525"
I noticed that this setting passing a float value, the format is invalid. changing the (.) for (,) in the float number the mask works but this is not correct. Ex: 2800.99 -> 280.099 2800,99 -> 2.800,99
Ref: #624
@lramondev If you use separator with thousandSeparator '.' default decimaMarker is ',' in another cases default decimalMarker - '.'
In 8.1.7
mask="separator.2"
thousandSeparator="."
decimalMarker=","
value = 9800.5 expected = 9.800,50 returned = 9.800,5 <----------where is the zero?
In 8.1.7
mask="separator.2" thousandSeparator="." decimalMarker=","
value = 9800.5 expected = 9.800,50 returned = 9.800,5 <----------where is zero?
any progress ?
https://github.com/JsDaddy/ngx-mask/projects/2#card-33124079
Hi, any update on this or can you tell when we can expect a fix? Thanks very much in advance
@GleberSchiavo @micru Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-dywnfl?file=src%2Fapp%2Faccordion-config.ts,src%2Fapp%2Faccordion-config.html,src%2Findex.html
@hitallow we add at latest version [leadZero] its add zero to the end of model