import { Pipe , PipeTransform } from '@angular/core' ; import { FormatterService } from '@core/formatter.service' ; @ Pipe ( { name : 'sharedDegrees' } ) export class DegreesPipe implements PipeTransform { constructor ( public formatter ) { } param value param decimals param empty param units return { String } transform ( value , decimals = 0 , units = '°' , empty = this . formatter . empty ) { const num = this . formatter . number ( value , decimals , empty ) ; return `${ num }${ units }` ; } }