0.1.6 • Published 6 years ago
ng-currency-format v0.1.6
Description
Angular 2+ currency display format and validation. Input value will automatically be displayed in currency format as you type. You can also define currency symbol and maximum value.
Installation
To install this library, run:
$ npm install ng-currency-format --save
and then from your Angular Module:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import CurrencyFormatDirective
import { CurrencyFormatDirective } from 'ng-currency-format';
@NgModule({
declarations: [
AppComponent,
// Add CurrencyFormatDirective
CurrencyFormatDirective
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once directive is imported, you can use it in your Angular components:
<input currencyFormat>
Currency Symbol
You can add currency symbol.
<input
currencyFormat
data-symbol="USD">
Maximum Value Validation
You can define data-max
value to prevent higher value input than specified value.
<input
currencyFormat
data-max="250000">
License
MIT © Burak