Angular ngx-mask prefilled data missing 0 when using suffix

1.4k views Asked by At

I have a component which display a formgroup input field. I am also using ngx-mask with the following setup in .ts:

mask: string = "separator,"
thousandSeparator: string = "."
suffix: string = ",00"

My html component is as followed

<div [formgroup]='form'>
  <input
    [formControlName]="name"
    [mask]="mask"
    [thousandSeparator]="thousandSeparator"
    [suffix]="suffix">
</div>

The problem is when the input has value of e.g 500, it wll turn into 5,00 instead of 500,00. Any other value e.g 999 will turn out good 999,00.

Does anyone know what I am doing wrong?

Update 1: It seems like using the suffix=",00" is causing this problem. When using suffix=",01" the number is correct

0

There are 0 answers