fin du refactp

This commit is contained in:
Tom Boullay
2026-04-14 14:27:50 +02:00
parent e9ae6ffc41
commit f9e15d5e1f
18 changed files with 826 additions and 476 deletions
+11
View File
@@ -0,0 +1,11 @@
// ---------------------------------------------------------------------------
// Format bytes to human-readable string
// ---------------------------------------------------------------------------
export function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]
}