1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #17496 -- Regression in the floatformat template filter, introduced by the fix for #15789.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin
2012-01-03 13:09:12 +00:00
parent c93933441e
commit e5719b203c
2 changed files with 3 additions and 1 deletions

View File

@@ -169,7 +169,7 @@ def floatformat(text, arg=-1):
# Set the precision high enough to avoid an exception, see #15789.
tupl = d.as_tuple()
units = len(tupl[1]) - tupl[2]
prec = abs(arg) + units + 1
prec = abs(p) + units + 1
# Avoid conversion to scientific notation by accessing `sign`, `digits`
# and `exponent` from `Decimal.as_tuple()` directly.