1.0.2 • Published 4 years ago

ngx-currency-input v1.0.2

Weekly downloads
38
License
MIT
Repository
github
Last release
4 years ago

Angular Currency Input Directive

gitter NPM version Build codecov.io code style: prettier semantic-release

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

NameDescription
@Input() formatOnlyOnBlur: booleanWhen true, the input won't be formatted while entering a value. Default: false
@Input() min: numberValidation min value
@Input() max: numberValidation 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