I have my input with currencyPipe, it works, but sometimes i need to add decimals numbers, but with the code that i'm using i can't do it.
this.form.valueChanges.subscribe(res => {
if(res.total_actives_amount){
this.form.patchValue({
total_actives_amount: this.currencyPipe.transform(res.total_actives_amount.replace(/\D/g, '').replace(/^0+/, ''), 'USD', 'symbol', '1.0-0')
}, {emitEvent: false});
}
})
I think that the problem is this line:
total_actives_amount: this.currencyPipe.transform(res.total_actives_amount.replace(/\D/g, '').replace(/^0+/, ''), 'USD', 'symbol', '1.0-0')