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

Preserve decimal values on model but not on display?

Open MikePogson opened this issue 4 years ago • 0 comments

Hi,

I was wondering if there was some way to preserve the decimals in a value but not displaying those decimals? What I am seeing is that as soon as a user edits the model value loses its decimals and that causes some data loss even though the user doesnt want to see it. I have a set up like this:

<input type="text" [allowNegativeNumbers]="true" mask="separator.0" thousandSeparator="," [(ngModel)]="amount">

where a model value of 99.99 after edit would turn into just 99. Is there anyway to preserve that decimal value?

Thanks

MikePogson avatar Apr 29 '21 23:04 MikePogson