blob: f3f57b8255e965a314aae3ab0452c63832abc046 (
plain) (
tree)
|
|
import { Pipe, PipeTransform } from '@angular/core'
import { getBytes } from '@root-helpers/bytes'
// Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/ng-pipes/pipes/math/bytes.ts
@Pipe({ name: 'bytes' })
export class BytesPipe implements PipeTransform {
transform (value: number, precision?: number | undefined): string | number {
return getBytes(value, precision)
}
}
|