This commit is contained in:
Kovid Goyal 2024-08-15 13:37:36 +05:30
parent a54cc071db
commit 8947b275e0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -144,7 +144,7 @@ def rating_to_stars(value, allow_half_stars=False, star='★', half='⯨'):
def human_readable(size, sep=' '):
if size == 0:
if size <= 0:
return f'0{sep}B'
i = Math.floor(Math.log(size) / Math.log(1024))
size = (size / Math.pow(1024, i)).toFixed(1)