From ec7fb68da6533358b809a9eba9fc54e2b11e3389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Thu, 16 Apr 2020 11:06:07 +0200 Subject: [PATCH] Fix the file size conversion --- frontend/js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/js/utils.js b/frontend/js/utils.js index bbb19c0..e31ee86 100644 --- a/frontend/js/utils.js +++ b/frontend/js/utils.js @@ -28,9 +28,9 @@ export const prettySize = (fileSizeInBytes) => { var i = -1; var byteUnits = [" kB", " MB", " GB", " TB", "PB", "EB", "ZB", "YB"]; do { - fileSizeInBytes = fileSizeInBytes / 1024; + fileSizeInBytes = fileSizeInBytes / 1000; i++; - } while (fileSizeInBytes > 1024); + } while (fileSizeInBytes > 1000); return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i]; };