mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Avoid trailing zeroes when formatting decimal series indices
This commit is contained in:
parent
41045fc367
commit
b7eb5bd5ac
@ -228,7 +228,10 @@ def fmt_sidx(i, fmt='%.2f', use_roman=False):
|
|||||||
return str(i)
|
return str(i)
|
||||||
if int(i) == float(i):
|
if int(i) == float(i):
|
||||||
return roman(int(i)) if use_roman else '%d'%int(i)
|
return roman(int(i)) if use_roman else '%d'%int(i)
|
||||||
return fmt%i
|
ans = fmt%i
|
||||||
|
if '.' in ans:
|
||||||
|
ans = ans.rstrip('0')
|
||||||
|
return ans
|
||||||
|
|
||||||
|
|
||||||
class Resource:
|
class Resource:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user