]>
Commit | Line | Data |
---|---|---|
94676e63 | 1 | import { Pipe, PipeTransform } from '@angular/core' |
b4c3c51d | 2 | import { getBytes } from '@root-helpers/bytes' |
94676e63 C |
3 | |
4 | // Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/ng-pipes/pipes/math/bytes.ts | |
5 | ||
6 | @Pipe({ name: 'bytes' }) | |
7 | export class BytesPipe implements PipeTransform { | |
94676e63 C |
8 | |
9 | transform (value: number, precision?: number | undefined): string | number { | |
b4c3c51d | 10 | return getBytes(value, precision) |
94676e63 C |
11 | } |
12 | } |