Fix: Add support for TB and PB in formatBytes

This commit is contained in:
Marius 2024-07-25 12:34:03 +02:00 committed by GitHub
parent 40aa663101
commit e56f783ef9
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));