initial commit

This commit is contained in:
Elias Schneider
2022-04-25 15:15:17 +02:00
commit 61be87b72a
72 changed files with 11502 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
export function bytesToSize(bytes: number) {
const sizes = ["B", "KB", "MB", "GB", "TB"];
if (bytes == 0) return "0 Byte";
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());
return (bytes / Math.pow(1024, i)).toFixed(1).toString() + " " + sizes[i];
}