ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

coma_separator with 4 decimals does not work

Open galan83 opened this issue 7 years ago • 7 comments

When I comma_separator defining 2 decimals, everything works like a charm, but if I need 4 decimals, mask works ok, but the form returns the value without any decimal.

e.g.

If I write 1,000.2523, the form control will store 10002523 as its value.

galan83 avatar Feb 14 '19 12:02 galan83

Could this be related to #302 ?

basvdijk avatar Feb 14 '19 15:02 basvdijk

I think so.

galan83 avatar Feb 14 '19 16:02 galan83

@galan83 you can grab the latest version of ngx-mask which solves this issue

basvdijk avatar Feb 14 '19 18:02 basvdijk

Hi again, thank you for your answers. I'm using last version of the library: 7.4.2

galan83 avatar Feb 14 '19 19:02 galan83

I've seen this in mask.service.ts:

if ((this.maskExpression === 'coma_separator.2' && this.dropSpecialCharacters === true)) { this.maskSpecialCharacters = this.maskSpecialCharacters.filter((item: string) => item !== '.'); }

I think that hardcoded 2 is the problem.

galan83 avatar Feb 14 '19 20:02 galan83

When I look at it, I think it should be comma instead of coma https://en.wikipedia.org/wiki/Comma

basvdijk avatar Feb 14 '19 20:02 basvdijk

When this gone to publish I still have this problem 🐞 , at 7.4.3

malbarmavi avatar Feb 20 '19 08:02 malbarmavi