]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-main/angular/bytes.pipe.ts
Replace all glyphicon icons
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / angular / bytes.pipe.ts
CommitLineData
94676e63 1import { Pipe, PipeTransform } from '@angular/core'
b4c3c51d 2import { 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' })
7export 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}