From: Ronny Pfannschmidt Date: Tue, 17 Aug 2010 11:18:41 +0000 (+0200) Subject: round filter: remove the special case for precission=0 in order to ensure consistent... X-Git-Tag: 2.5.3~3^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e589a3e20e3af316a13dc5db763d286fccca62c6;p=jinja2.git round filter: remove the special case for precission=0 in order to ensure consistent output types on python3 --HG-- branch : trunk --- diff --git a/jinja2/filters.py b/jinja2/filters.py index 6378f5b..d1848e4 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -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