0.0.0 • Published 6 years ago

ngx-currency-formatter-library v0.0.0

Weekly downloads
4
License
-
Repository
-
Last release
6 years ago

NgxCurrencyFormatter

I made this library because i needed a component (as simple as possible) that just renders the value in my input field as if it was piped through the currency pipe. It does accept the options code and digit which are passed throught to the durrency pipes properties.

Demo

https://druckreich.github.io/ngx-currency-formatter-library

How to Use

How to install dependencies
npm install ng-currency-formatter
How to import Module
import {NgxCurrencyFormatterModule} from 'ng-currency-formatter'

@NgModule({
  imports: [
    NgxCurrencyFormatterModule,
  ]
})
How to use formatter on input
<input type="text" ngxCurrencyFormatter [(ngModel)]="value">
How to use different locale and digit
<input type="text" ngxCurrencyFormatter [code]="'EUR'">
<input type="text" ngxCurrencyFormatter [digit]="'1.4'">
How to use validator on input
<input type="text" ngxCurrencyFormatter [(ngModel)]="value" ngxCurrencyValidator>
How to use custom validator error message
@NgModule({
  providers: [
    {provide: 'ngxCurrencyConfig', useValue: {message: 'I do not like this number, Sir!'}},
  ]
})