export - output files

This commit is contained in:
Jan Prochazka
2020-06-07 18:11:06 +02:00
parent f37524f76f
commit f63788f79b
10 changed files with 131 additions and 21 deletions

View File

@@ -0,0 +1,6 @@
export default function formatFileSize(size) {
if (size > 1000000000) return `${Math.round(size / 10000000000) * 10} GB`;
if (size > 1000000) return `${Math.round(size / 10000000) * 10} MB`;
if (size > 1000) return `${Math.round(size / 10000) * 10} KB`;
return `${size} bytes`;
}