diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts new file mode 100644 index 000000000..077831ac2 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts @@ -0,0 +1,12 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +import _ from 'lodash'; + +@Pipe({ + name: 'round' +}) +export class RoundPipe implements PipeTransform { + transform(value: any, precision: number): any { + return _.round(value, precision); + } +} |