How to have thousand separator and decimal separator at once in ngx mask using angular7?

Viewed 7437

I have an angular7 app in which i have an input on which i have to apply mask using ngx-mask.

I have the input like this

<input matInput mask="separator.2" thousandSeparator=","  [(ngModel)]="currency">

It gives me result like this

3,000,000,000,000

But i want the result like this

3,000,000,000,000.00

That means i also want .00 formatting at the end of the value entered. and if user entered this value

3,000,000,000,000.345

so that value preserves, and i don't want .00 then because .345 is already there.

Stackblitz link is here

2 Answers
Related