ngx-currency-input
v1.0.2
Published
[![gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/filipows/ngx-currency-input?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![NPM version](https://img.shields.io/npm/v/ngx-currency-input.svg?style=flat-s
Downloads
66
Maintainers
Readme
Angular Currency Input Directive
Input directive to format number according to users locale and preventing from entering more than 2 decimal places.
Quick links
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
- Chris Filipowski - filipows
License
This project is licensed under the MIT License - see the LICENSE file for details