Fix potential division by 0
This commit is contained in:
parent
bde91ca936
commit
0211596508
|
@ -207,7 +207,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
|
|||
self.insertCol(column_insertion, self.iwla._('Ratio'), u'iwla_hit')
|
||||
for (index, r) in enumerate(self.rows):
|
||||
val = r[column] and int(r[column]) or 0
|
||||
self.setCellValue(index, column_insertion, '%.1f%%' % (float(val*100)/float(total)))
|
||||
self.setCellValue(index, column_insertion, '%.1f%%' % (total and float(val*100)/float(total) or 0))
|
||||
|
||||
def _filter(self, function, column, args):
|
||||
target_col = None
|
||||
|
|
Loading…
Reference in New Issue
Block a user