From 25dbf846f17a36603500ac6e517189558f7e7c64 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Mon, 15 Apr 2024 10:57:23 +0800 Subject: [PATCH] =?UTF-8?q?v6.0=20=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=B1=95=E7=A4=BA=E4=BC=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/js/common.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index d96fbf969..c8402db93 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -4678,16 +4678,16 @@ $(function () { $.each(this.files, function () { var unit = 'KB'; var size = 0; - if (this.size < 1024) { + var kb = this.size / 1024; + if (kb < 1024) { unit = 'KB'; - size = Math.round((this.size / 1024) * 100) / 100; - } else if (this.size < 1024 * 1024) { + size = Math.round(kb * 100) / 100; + } else if (kb < 1024 * 1024) { unit = 'MB'; size = Math.round((this.size / (1024 * 1024)) * 100) / 100; - } else if (this.size < 1024 * 1024 * 1024) { + } else if (kb < 1024 * 1024 * 1024) { unit = 'GB'; size = Math.round((this.size / (1024 * 1024 * 1024)) * 100) / 100; - } fileNames += '' + this.name + ' (' + size + unit + ')'; }); -- GitLab