ng-currency-formatter
v6.0.0
Published
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
Downloads
6
Readme
NgxCurrenyFormatter
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/ng-currency-formatter
How to Use
How to install dependencies
npm install ng-currency-formatter
How to import Module
import {NgCurrencyFormatterModule} from 'ng-currency-formatter'
@NgModule({
imports: [
NgCurrencyFormatterModule,
]
})
How to use formatter on input
<input type="text" ngCurrencyFormatter [(ngModel)]="value">
How to use different locale and digit
<input type="text" ngCurrencyFormatter [code]="'EUR'">
<input type="text" ngCurrencyFormatter [digit]="'1.4'">
How to use validator on input
<input type="text" ngCurrencyFormatter [(ngModel)]="value" ngCurrencyValidator>
How to use custom validator error message
@NgModule({
providers: [
{provide: 'ngCurrencyConfig', useValue: {message: 'I do not like this number, Sir!'}},
]
})