Angular Currency Input Directive
Input directive to format number according to users locale and preventing from entering more than 2 decimal places.
Quick links
Demo |
StackBlitz Template
Getting Started
Installation
npm i ngx-currency-input --save
Import NgxCurrencyInput Module
import { NgxCurrencyInputModule } from 'ngx-currency-input';
@NgModule({
declarations: [...],
imports: [
...
NgxCurrencyInputModule
]
})
export class AppModule {}
Usage
<input ngxCurrencyInput [(ngModel)]="value" />
Available Options
Name | Description |
---|
@Input() formatOnlyOnBlur : boolean | When true , the input won't be formatted while entering a value. Default: false |
@Input() min : number | Validation min value |
@Input() max : number | Validation max value |
Example:
<input ngxCurrencyInput [formatOnlyOnBlur]="true" [min]="10" [max]="1000" [(ngModel)]="value" />
Authors
License
This project is licensed under the MIT License - see the LICENSE file for details