mirror of https://github.com/Chocobozzz/PeerTube
13 lines
394 B
TypeScript
13 lines
394 B
TypeScript
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)
|
|
}
|
|
}
|