round cpu exec time

This commit is contained in:
janani
2019-06-12 17:25:59 +02:00
parent 344055c4d2
commit 63a7134cbb
+3 -3
View File
@@ -11,8 +11,8 @@ class JobMetricFormatter(object):
def seconds_to_str(value):
"""Convert seconds to a simple simple string describing the amount of time."""
if value < 60:
return "%s seconds" % value
return "%s seconds" % round(value, 2)
elif value < 3600:
return "%s minutes" % (value / 60)
return "%s minutes" % round(value / 60, 2)
else:
return "%s hours and %s minutes" % (value / 3600, (value % 3600) / 60)
return "%s hours and %s minutes" % (round(value / 3600, 2), round((value % 3600) / 60, 2))