mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
a54cc071db
commit
8947b275e0
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user