From 38596d017f842ba64dd1cfef64ce9623ea04cd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Kr=C3=A4mer?= Date: Wed, 19 Jul 2023 23:59:00 +0200 Subject: [PATCH] Fix byte conversion --- server/utils/fileUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 5751372f..7988857f 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -83,7 +83,7 @@ function bytesPretty(bytes, decimals = 0) { if (bytes === 0) { return '0 Bytes' } - const k = 1024 + const k = 1000 var dm = decimals < 0 ? 0 : decimals const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] const i = Math.floor(Math.log(bytes) / Math.log(k)) @@ -265,4 +265,4 @@ module.exports.removeFile = (path) => { module.exports.encodeUriPath = (path) => { return filePathToPOSIX(path).replace(/%/g, '%25').replace(/#/g, '%23') -} \ No newline at end of file +}