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/ngx-currency-formatter-library
npm install ng-currency-formatter
import {NgxCurrencyFormatterModule} from 'ng-currency-formatter'
@NgModule({
imports: [
NgxCurrencyFormatterModule,
]
})
<input type="text" ngxCurrencyFormatter [(ngModel)]="value">
<input type="text" ngxCurrencyFormatter [code]="'EUR'">
<input type="text" ngxCurrencyFormatter [digit]="'1.4'">
<input type="text" ngxCurrencyFormatter [(ngModel)]="value" ngxCurrencyValidator>
@NgModule({
providers: [
{provide: 'ngxCurrencyConfig', useValue: {message: 'I do not like this number, Sir!'}},
]
})