ngx-mask icon indicating copy to clipboard operation
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

Open Gleber-Sch opened this issue 4 years ago • 7 comments

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"

Gleber-Sch avatar Oct 29 '19 14:10 Gleber-Sch

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

lramondev avatar Nov 05 '19 13:11 lramondev

Ref: #624

mrmokwa avatar Nov 05 '19 14:11 mrmokwa

@lramondev If you use separator with thousandSeparator '.' default decimaMarker is ',' in another cases default decimalMarker - '.'

isysenko avatar Dec 26 '19 10:12 isysenko

In 8.1.7

mask="separator.2"
thousandSeparator="."
decimalMarker=","

value = 9800.5 expected = 9.800,50 returned = 9.800,5 <----------where is the zero?

lramondev avatar Dec 28 '19 13:12 lramondev

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 ?

hitallow avatar May 27 '20 13:05 hitallow

https://github.com/JsDaddy/ngx-mask/projects/2#card-33124079

lramondev avatar May 27 '20 13:05 lramondev

Hi, any update on this or can you tell when we can expect a fix? Thanks very much in advance

micru avatar Sep 22 '20 07:09 micru

@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

andriikamaldinov1 avatar Jun 13 '23 08:06 andriikamaldinov1