From d2ad6eb2f6bafbaa3952f0861abbe40996e448a0 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 5 Sep 2019 08:09:49 +0200 Subject: [PATCH] use 1000 instead of 1024 to show correct fileSize --- scm-ui-components/packages/ui-components/src/FileSize.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-ui-components/packages/ui-components/src/FileSize.js b/scm-ui-components/packages/ui-components/src/FileSize.js index c7d966d901..2796e0fd0c 100644 --- a/scm-ui-components/packages/ui-components/src/FileSize.js +++ b/scm-ui-components/packages/ui-components/src/FileSize.js @@ -12,9 +12,9 @@ class FileSize extends React.Component { } const units = ["B", "K", "M", "G", "T", "P", "E", "Z", "Y"]; - const i = Math.floor(Math.log(bytes) / Math.log(1024)); + const i = Math.floor(Math.log(bytes) / Math.log(1000)); - const size = i === 0 ? bytes : (bytes / 1024 ** i).toFixed(2); + const size = i === 0 ? bytes : (bytes / 1000 ** i).toFixed(2); return `${size} ${units[i]}`; }