mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 11:53:46 +02:00
Avoid trailing zeroes when formatting decimal series indices
This commit is contained in:
parent
41045fc367
commit
b7eb5bd5ac
1 changed files with 4 additions and 1 deletions
|
|
@ -228,7 +228,10 @@ def fmt_sidx(i, fmt='%.2f', use_roman=False):
|
|||
return str(i)
|
||||
if int(i) == float(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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue