fix #3670
This commit is contained in:
jxxghp
2025-01-07 14:20:31 +08:00
parent b5d58b8a9e
commit 23650657cd
17 changed files with 25 additions and 23 deletions

View File

@@ -227,7 +227,7 @@ class StringUtils:
size = float(size)
d = [(1024 - 1, 'K'), (1024 ** 2 - 1, 'M'), (1024 ** 3 - 1, 'G'), (1024 ** 4 - 1, 'T')]
s = [x[0] for x in d]
index = bisect.bisect_left(s, size) - 1
index = bisect.bisect_left(s, size) - 1 # noqa
if index == -1:
return str(size) + "B"
else: