From 86ea15e661da496ae65806a684cc062b57ba689a Mon Sep 17 00:00:00 2001 From: jordan Date: Mon, 1 Aug 2011 11:08:30 +0000 Subject: [PATCH] OSQA-525, use old style syntax for the if-statements, adds a bit of backwards compatibility git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1145 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/templatetags/extra_filters.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forum/templatetags/extra_filters.py b/forum/templatetags/extra_filters.py index e13923f..8dea68c 100644 --- a/forum/templatetags/extra_filters.py +++ b/forum/templatetags/extra_filters.py @@ -22,7 +22,12 @@ def decorated_int(number, cls="thousand"): number = int(number) # allow strings or numbers passed in if number > 999: thousands = float(number) / 1000.0 - format = "%.1f" if number < 99500 else "%.0f" + + if number < 99500: + format = "%.1f" + else: + format = "%.0f" + s = format % thousands return mark_safe("%sk" % (cls, s)) -- 2.39.5