import { Pipe , PipeTransform , NgModule } from '@angular/core' ; import { createRound , isString } from '../utils/utils' ; @ Pipe ( { name : 'floor' , } ) export class FloorPipe implements PipeTransform { transform ( value , precision = 0 ) { if ( isString ( precision ) ) { precision = parseInt ( precision ) ; } return createRound ( 'floor' ) ( value , precision ) ; } } @ NgModule ( { declarations : [ FloorPipe ] , exports : [ FloorPipe ] , } ) export class NgFloorPipeModule { }