This commit is contained in:
Flummi
2020-04-09 18:44:09 +02:00
parent 46082780e1
commit 97096357e5
17 changed files with 39 additions and 8829 deletions

View File

@@ -2,4 +2,7 @@ export default new class {
formatSize(size, i = ~~(Math.log(size) / Math.log(1024))) {
return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "kB", "MB", "GB", "TB"][i];
}
calcSpeed(b, s) {
return `${(Math.round((b * 8 / s / 1e6) * 1e4) / 1e4).toFixed(2)} Mbit/s`;
}
};