import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'priceFormatter' } ) export class PriceFormatterPipe implements PipeTransform { transform ( price ) { return price . toFixed ( 2 ) . replace ( /\d(?=(\d{3})+\.)/g , '$&,' ) ; } }