cesarrew / ng2-currency-mask

A very simple currency mask directive that allows using a number attribute with the ngModel.
MIT License
235 stars 116 forks source link

Decimal options is ignore when I set decimal: '.' #149

Open camp0sfer opened 4 years ago

camp0sfer commented 4 years ago

Hi there, I am using angular with ng2-currency-mask and want to implement decimal with '.' but it doesn't work :(

This is my code: <input formControlName="example" matInput currencyMask [options]="{ prefix: '', decimal: '.', thousands: '.', precision: '6', allowNegative: true }" max="99" maxlength="10">

When I set decimal: '.' in the options and digit the value 111111111 on input, works visually (the input show the value 111.111111), but printing the value of my formcontrol I have the value 111111111

When I change the decimal for decimal: ',' the value of formcontrol is 111.111111

All I want is show 111.111111 on input and have the value 111.111111 in my formcontrol.

Sorry for my bad english, I hope someone can have a look and help me. Thanks!