fix: byte units (#4419)

This commit is contained in:
Cubxity 2022-10-10 00:09:24 +02:00 committed by GitHub
parent e0e0689846
commit 597821b3bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 19 deletions

View file

@ -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]}`;
}
/**