diff --git a/shandan-browser/src/main/resources/static/js/browser.js b/shandan-browser/src/main/resources/static/js/browser.js index 8643d96..31f626b 100644 --- a/shandan-browser/src/main/resources/static/js/browser.js +++ b/shandan-browser/src/main/resources/static/js/browser.js @@ -644,7 +644,7 @@ function fileSizeFormat(size, initUnit = 'B') { const i = units.indexOf(initUnit); if (size > 1024 && i < units.length - 1) { return fileSizeFormat(size / 1024, units[i + 1]); - } else if (size < 1 && i > -1) { + } else if (size < 1 && i > 0) { return fileSizeFormat(size * 1024, units[i - 1]); } else { return Math.round(size * 100) / 100 + initUnit;