I want to keep .0 when use ngx-mask in angular

1.1k views Asked by At

when I use ngx-mask in angular, it automatically deletes .0 when server response 1.0, ex: 1.0 => 1 So I want to prevent this.

1.0 keep 1.0 not 1 when use ngx-mask

1

There are 1 answers

3
Srikanth On

If you are consistent with decimal points then you can consider using number pipe. Good luck!

{{ tr | number : '1.2-2'}}

Here is the example if you are using [(ngModel)]. Working example