Merge "Fix incorrect __round__ behaviour"

This commit is contained in:
Zuul 2020-01-15 15:07:42 +00:00 committed by Gerrit Code Review
commit b5eaf963d0
1 changed files with 5 additions and 1 deletions

View File

@ -330,7 +330,11 @@ class Table(Chart):
:returns: rounded float
:returns: str "n/a"
"""
return round(ins.result(), 3) if has_result else "n/a"
r = ins.result()
if not has_result or r is None:
return "n/a"
else:
return round(r, 3)
def _row_has_results(self, values):
"""Determine whether row can be assumed as having values.