Fix #2572 (Error when Restoring from Tray)

This commit is contained in:
Kovid Goyal 2009-06-10 23:04:40 -07:00
parent c073180d03
commit 97386ccb9d

View File

@ -61,8 +61,9 @@ def roman(num):
def fmt_sidx(i, fmt='%.2f', use_roman=False): def fmt_sidx(i, fmt='%.2f', use_roman=False):
if i is None: if i is None or i == '':
i = 1 i = 1
i = float(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)
try: try: