Merge pull request #156 from kielerdotdev/patch-1

Add support for TB and PB in formatBytes in webui
This commit is contained in:
Igor Katson 2024-07-25 12:07:14 +01:00 committed by GitHub
commit 81755c55d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@ export function formatBytes(bytes: number): string {
if (bytes === 0) return "0 Bytes";
const k = 1024;
const sizes = ["Bytes", "KB", "MB", "GB"];
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));