]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - 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
1 import { Pipe, PipeTransform } from '@angular/core'
2 import { getBytes } from '@root-helpers/bytes'
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 {
8
9 transform (value: number, precision?: number | undefined): string | number {
10 return getBytes(value, precision)
11 }
12 }