]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | import { Pipe, PipeTransform } from '@angular/core'; |
f67539c2 | 2 | |
11fdf7f2 TL |
3 | import { FormatterService } from '../services/formatter.service'; |
4 | ||
5 | @Pipe({ | |
6 | name: 'dimlessBinaryPerSecond' | |
7 | }) | |
8 | export class DimlessBinaryPerSecondPipe implements PipeTransform { | |
9 | constructor(private formatter: FormatterService) {} | |
10 | ||
11 | transform(value: any): any { | |
12 | return this.formatter.format_number(value, 1024, [ | |
13 | 'B/s', | |
05a536ef TL |
14 | 'KiB/s', |
15 | 'MiB/s', | |
16 | 'GiB/s', | |
17 | 'TiB/s', | |
18 | 'PiB/s', | |
19 | 'EiB/s', | |
20 | 'ZiB/s', | |
21 | 'YiB/s' | |
11fdf7f2 TL |
22 | ]); |
23 | } | |
24 | } |