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.
https://druckreich.github.io/ng-currency-formatter
npm install ng-currency-formatter
import {NgCurrencyFormatterModule} from 'ng-currency-formatter'
@NgModule({
imports: [
NgCurrencyFormatterModule,
]
})
<input type="text" ngCurrencyFormatter [(ngModel)]="value">
<input type="text" ngCurrencyFormatter [code]="'EUR'">
<input type="text" ngCurrencyFormatter [digit]="'1.4'">
<input type="text" ngCurrencyFormatter [(ngModel)]="value" ngCurrencyValidator>
@NgModule({
providers: [
{provide: 'ngCurrencyConfig', useValue: {message: 'I do not like this number, Sir!'}},
]
})
This is my first library - small but useful - at least for me =D
IF you have any suggestions or issues please drop me a message