ngx-currency-input
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

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

Package Sidebar

Install

npm i ngx-currency-input

Weekly Downloads

19

Version

1.0.2

License

MIT

Unpacked Size

279 kB

Total Files

23

Last publish

Collaborators

  • filipows