Ngx-mask: When I use the mask="separator.2" and thousand Separator="." with an input inside accordion component the comma character disappear

Created on 29 Oct 2019  路  7Comments  路  Source: JsDaddy/ngx-mask

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:

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"

P1 bug help wanted

Most helpful comment

In 8.1.7

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

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

All 7 comments

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 ?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

cabbott65 picture cabbott65  路  4Comments

dimmal picture dimmal  路  3Comments

humpedli picture humpedli  路  3Comments

renanBritz picture renanBritz  路  3Comments