diff --git a/src/js/utils.js b/src/js/utils.js index 4357c31..fd5754d 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -39,13 +39,13 @@ const sizes = { 'GB': Math.pow(2, 30), 'MB': Math.pow(2, 20), 'KB': Math.pow(2, 10), - 'B': -1 + 'B': 0 } export function humanSize(size) { for (let key in sizes) { let value = sizes[key]; - if (size > value) { + if (size >= value) { return Math.round(size / value) + key; } }