0.1.6 • Published 6 years ago

ng-currency-format v0.1.6

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

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

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago