From e589a3e20e3af316a13dc5db763d286fccca62c6 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 17 Aug 2010 13:18:41 +0200 Subject: [PATCH] round filter: remove the special case for precission=0 in order to ensure consistent output types on python3 --HG-- branch : trunk --- jinja2/filters.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 -- 2.26.2