round filter: remove the special case for precission=0 in order to ensure consistent...
authorRonny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
Tue, 17 Aug 2010 11:18:41 +0000 (13:18 +0200)
committerRonny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
Tue, 17 Aug 2010 11:18:41 +0000 (13:18 +0200)
--HG--
branch : trunk

jinja2/filters.py

index 6378f5beb4489b8dc8aa40e97a1f49f280c2312a..d1848e434d32405ed8e597de19288af80a4b3f85 100644 (file)
@@ -558,10 +558,7 @@ def do_round(value, precision=0, method='common'):
     if method == 'common':
         return round(value, precision)
     func = getattr(math, method)
-    if precision:
-        return func(value * (10 ** precision)) / (10 ** precision)
-    else:
-        return func(value)
+    return func(value * (10 ** precision)) / (10 ** precision)
 
 
 @environmentfilter