From 54fe913323c5e2242ec2c0e022c048095865e334 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Mon, 7 Aug 2023 00:42:10 +0800 Subject: [PATCH] chore(api/utils): use open condition for the right side --- nvitop/api/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvitop/api/utils.py b/nvitop/api/utils.py index 5769190..d331721 100644 --- a/nvitop/api/utils.py +++ b/nvitop/api/utils.py @@ -545,11 +545,11 @@ def bytes2human( return f'{b}B' if b < MiB and min_unit <= KiB: return f'{round(b / KiB)}KiB' - if b <= 100 * MiB and min_unit <= MiB: + if b < 100 * MiB and min_unit <= MiB: return f'{round(b / MiB, 2):.2f}MiB' - if b <= 1000 * MiB and min_unit <= MiB: + if b < 1000 * MiB and min_unit <= MiB: return f'{round(b / MiB, 1):.1f}MiB' - if b <= 20 * GiB and min_unit <= MiB: + if b < 20 * GiB and min_unit <= MiB: return f'{round(b / MiB)}MiB' if b < 100 * GiB and min_unit <= GiB: return f'{round(b / GiB, 2):.2f}GiB'