ng2-money-mask Directive
A very simple currency mask directive for Angular. You should use the version 4.x.x for Angular 4.x.x applications and the version 5.x.x for Angular 5.x.x applications.
Note: This component is NOT ready to AoC (Ahead-of-Time) compilation.
Getting Started
Installing and Importing
Install the package by command:
npm install ng2-money-mask --save
Import the module
;
Using
ngModel
will get/set the value with text (example:'$ 1,234.56'
) ;moneyModel
will get/set the number value (example:1234.56
);
Options
You can set options...
<!-- example for pt-BR money -->
Available options:
allowNegative
- Iftrue
can input negative values. (default:false
)precision
- Number of decimal places (default:2
)thousands
- Separator of thousands (default:','
)decimal
- Separator of decimals (default:'.'
)prefix
- Money preffix (is included in ngModel) (default:'$ '
)suffix
- Money suffix (is included in ngModel) (default:''
)
## Questions? Open a Issue!