Skip to content

Commit

Permalink
[hotfix][web] Show - in humanizeBytes for negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
rkhachatryan committed Jan 25, 2021
1 parent 36e8221 commit bd8d680
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -24,9 +24,9 @@ import { isNil } from 'utils';
})
export class HumanizeBytesPipe implements PipeTransform {
transform(value: number): any {
if (isNil(value)) {
if (isNil(value) || value < 0) {
return '-';
}
}
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
const converter = (v: number, p: number): string => {
const base = Math.pow(1024, p);
Expand Down

0 comments on commit bd8d680

Please sign in to comment.