mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Avoid zero-div
This commit is contained in:
parent
8ef6938e03
commit
67aca61d0c
@ -128,6 +128,8 @@ def format_time_left(seconds):
|
||||
|
||||
|
||||
def format_pos(progress_frac, length):
|
||||
if length < 1:
|
||||
return ''
|
||||
pages = Math.ceil(length / 1000)
|
||||
pos = progress_frac * pages
|
||||
return f'{pos:.1f} / {pages}'
|
||||
|
Loading…
x
Reference in New Issue
Block a user