From 1fc1c56aa9b944616e6fca704bee5c6b4b9a1c26 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Sat, 5 Jul 2014 10:39:00 -0500 Subject: [PATCH] fix error on stats when translation had %f in different place --- anki/stats.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/anki/stats.py b/anki/stats.py index 3ab1ce20b..f127eca1a 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -354,13 +354,14 @@ group by day order by day""" % (self._limit(), lim), if total and tot: perMin = total / float(tot) perMin = round(perMin, 1) - perMin = _("%.01f cards/minute") % perMin # don't round down to zero - if float(perMin.split(' ')[0]) < 0.1: - perMin = _("less than 0.1 cards/minute") + if perMin < 0.1: + text = _("less than 0.1 cards/minute") + else: + text = _("%.01f cards/minute") % perMin self._line( i, _("Average answer time"), - _("%(a)0.1fs (%(b)s)") % dict(a=(tot*60)/total, b=perMin)) + _("%(a)0.1fs (%(b)s)") % dict(a=(tot*60)/total, b=text)) return self._lineTbl(i), int(tot) def _splitRepData(self, data, spec):