summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/template/defaultfilters.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index 8e5bcf5bd8..cef314387a 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -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))
else: