From 6fb202d55943f119b5a0afabb68a813612a90ff2 Mon Sep 17 00:00:00 2001 From: Alex Thomassen Date: Tue, 31 Oct 2023 15:38:06 +0100 Subject: [PATCH] Fix math on human filesize to match the relays page --- relays.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relays.js b/relays.js index 4f536a2..9c0ad93 100644 --- a/relays.js +++ b/relays.js @@ -8,8 +8,8 @@ function humanByteSize(input) { return '0 B'; } - const i = Math.floor(Math.log(input) / Math.log(1024)); - return (input / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; + const i = Math.floor(Math.log(input) / Math.log(1000)); + return (input / Math.pow(1000, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]; } // Convert seconds to human friendly time, with days