Commit be502ba7 authored by fred's avatar fred

include two digits in percentage

parent 7def6400
......@@ -71,7 +71,7 @@ class ZoneStats(object):
total = self.count()
if total == 0:
return '-'
return str(100 * self.count(**kwargs) / total) + '%'
return '%.2f' % (100 * self.count(**kwargs) / total)
def instru(self):
return self.count(instru=True)
......@@ -98,7 +98,7 @@ class ZoneStats(object):
considered_tracks = self.count() - self.instru()
if considered_tracks == 0:
return '-'
return str(100 * self.french() / considered_tracks)
return '%.2f' % (100 * self.french() / considered_tracks)
class StatisticsView(TemplateView):
template_name = 'nonstop/statistics.html'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment