fix: byte units (#4419)
This commit is contained in:
parent
e0e0689846
commit
597821b3bb
4 changed files with 19 additions and 19 deletions
|
@ -20,7 +20,7 @@ function bytesToString(bytes: number, decimals = 2): string {
|
|||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
const value = Number((bytes / Math.pow(k, i)).toFixed(decimals));
|
||||
|
||||
return `${value} ${['Bytes', 'KB', 'MB', 'GB', 'TB'][i]}`;
|
||||
return `${value} ${['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'][i]}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue