IO-134 Limit shop uploads based on plan.

This commit is contained in:
Patrick Fic
2021-04-05 16:57:44 -07:00
parent e3b0aba892
commit 50581c98e0
25 changed files with 671 additions and 17 deletions

View File

@@ -0,0 +1,10 @@
export default function formatBytes(a, b = 2) {
if (0 === a || !a) return "0 Bytes";
const c = 0 > b ? 0 : b,
d = Math.floor(Math.log(a) / Math.log(1024));
return (
parseFloat((a / Math.pow(1024, d)).toFixed(c)) +
" " +
["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d]
);
}