Merge pull request #8 from chdanielmueller/master

Memory stats fix
pull/20/head
Heiner 2020-06-28 14:18:01 +02:00 zatwierdzone przez GitHub
commit d1ecca4a1c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -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;