Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

FIxed #6513 -- Handle overflows better in the floatformat filter. It'…

…s not

possible to test this automatically everywhere due to differing representations
on different platforms. Manual testing confirms it works, though.

Thanks, Karen Tracey.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 516102dc756bdfbb0d71185067d0ec1ab91adef3 1 parent 463a03d
@malcolmt malcolmt authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/template/
5 django/template/
@@ -124,7 +124,10 @@ def floatformat(text, arg=-1):
d = int(arg)
except ValueError:
return force_unicode(f)
- m = f - int(f)
+ try:
+ m = f - int(f)
+ except OverflowError:
+ return force_unicode(f)
if not m and d < 0:
return mark_safe(u'%d' % int(f))

0 comments on commit 516102d

Please sign in to comment.
Something went wrong with that request. Please try again.