From 48d4d77cdbeb15704e476a5c272cfdd4c9f14dac Mon Sep 17 00:00:00 2001 From: chdanielmueller Date: Sun, 28 Jun 2020 14:16:06 +0200 Subject: [PATCH] Memory stats fix @HansMolenveld --- stats.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stats.js b/stats.js index d9dce1a..4d97a4a 100644 --- a/stats.js +++ b/stats.js @@ -13,13 +13,13 @@ var getBytes = function(s) { var bytes = 0; var value = s.match(/\d+/g)[0]; var unit = s.match(/[a-zA-Z]+/g)[0].toUpperCase(); - if (unit == 'KB') { + if (unit == 'KB' || unit == 'KIB') { return value*1024; - } else if (unit == 'MB') { + } else if (unit == 'MB' || unit == 'MIB') { return value*1024*1024; - } else if (unit == 'GB') { + } else if (unit == 'GB' || unit == 'GIB') { return value*1024*1024*1024; - } else if (unit == 'TB') { + } else if (unit == 'TB' || unit == 'TIB') { return value*1024*1024*1024*1024; } return bytes;