import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'sharedRoman' } ) export class RomanPipe implements PipeTransform { static MMI_ROMAN = [ 'I' , 'I' , 'II' , 'III' , 'IV' , 'V' , 'VI' , 'VII' , 'VIII' , 'IX' , 'X' , 'XI' , 'XII' ] ; param mmi return { any } transform ( mmi , noMmi = 'N/A' ) { let value ; mmi = Math . round ( parseFloat ( mmi ) ) ; value = RomanPipe . MMI_ROMAN [ mmi ] ; if ( value ) { return value ; } return noMmi ; } }