Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 98a06c1

Browse files
committed
Clean up code
1 parent 825e69b commit 98a06c1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

static/scripts/script.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,11 +1125,11 @@ function log(text) {
11251125
infoLine.innerHTML = text;
11261126
}
11271127

1128+
const conversionFactor = 1024.0;
1129+
const units = ["B", "KB", "MB", "GB", "TB", "PB"];
1130+
11281131
function humanizeBytes(bytes) {
11291132
bytes = Math.round(bytes); // when calculating average bytes can be float
1130-
const conversionFactor = 1024.0;
1131-
1132-
const units = ["B", "KB", "MB", "GB", "TB", "PB"];
11331133

11341134
let idx = 0;
11351135
while (bytes >= conversionFactor && idx < units.length - 1) {
@@ -1148,9 +1148,9 @@ function roundToDecimals(value, decimals) {
11481148
}
11491149

11501150
function _humanizeTime(sec) {
1151-
var hours = Math.floor(sec / 3600);
1152-
var minutes = Math.floor((sec - (hours * 3600)) / 60);
1153-
var seconds = sec - (hours * 3600) - (minutes * 60);
1151+
const hours = Math.floor(sec / 3600);
1152+
const minutes = Math.floor((sec - (hours * 3600)) / 60);
1153+
const seconds = sec - (hours * 3600) - (minutes * 60);
11541154

11551155
let text = "";
11561156

0 commit comments

Comments
 (0)