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

How to make it accept whole number? #175

Open tapasbose opened 1 year ago

tapasbose commented 1 year ago

Hello, I am using the following configuration:

{
  align: 'left',
  allowNegative: false,
  decimal: '.',
  precision: 2,
  prefix: '₹',
  suffix: '',
  thousands: ','
};

If I want to enter 100, and if I type 100, it masks into ₹1.00, I need to type 100.00 explicitly.

Is there any way to have the behavior in a way, that if I don't type decimal and just enter the whole number, it will automatically mask it into a decimal number with precision 2?

Thanks and regards, Tapas