added file size

This commit is contained in:
2021-07-27 21:24:20 +02:00
parent c20e894d52
commit a24ed03e1f
7 changed files with 465 additions and 452 deletions

View File

@@ -0,0 +1,7 @@
function sizeToReadable(size: number): string {
const i = Math.floor(Math.log(size) / Math.log(1024))
return (size / Math.pow(1024, i)).toFixed(2) + " " + ["B", "kB", "MB", "GB", "TB"][i]
}
export default sizeToReadable