.
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user