From 666678ef2323b8207a32ae690f0281a618b3ce51 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 25 Jan 2024 22:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=89=EF=BC=8Ccopilot=E6=88=91=E8=B0=A2?= =?UTF-8?q?=E8=B0=A2=E4=BD=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 841d37a..8f6b80b 100644 --- a/main.py +++ b/main.py @@ -232,11 +232,11 @@ async def add_message(data: Dict[str, Any]): online_bandwidth: int = data["bandwidth"] data_lens = ["B", "KB", "MB", "GB", "TB"] for i in range(5): - if data_bandwidth < 1024: - data_bandwidth = round(data_bandwidth, 5) - data_bandwidth = f"{data_bandwidth}{data_lens[i]}" + if data_bytes < 1024: + data_bytes = round(data_bytes, 5) + data_bytes = f"{data_bytes}{data_lens[i]}" break - data_bandwidth /= 1024 + data_bytes /= 1024 report_msg = ( "OpenBMCLAPI 状态:\n"