projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd0039c
)
round filter: remove the special case for precission=0 in order to ensure consistent...
author
Ronny Pfannschmidt
<Ronny.Pfannschmidt@gmx.de>
Tue, 17 Aug 2010 11:18:41 +0000
(13:18 +0200)
committer
Ronny Pfannschmidt
<Ronny.Pfannschmidt@gmx.de>
Tue, 17 Aug 2010 11:18:41 +0000
(13:18 +0200)
--HG--
branch : trunk
jinja2/filters.py
patch
|
blob
|
history
diff --git
a/jinja2/filters.py
b/jinja2/filters.py
index 6378f5beb4489b8dc8aa40e97a1f49f280c2312a..d1848e434d32405ed8e597de19288af80a4b3f85 100644
(file)
--- 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