Django

Code

Show
Ignore:
Timestamp:
03/20/08 02:36:33 (7 months ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/defaultfilters.py

    r7153 r7336  
    125125    except ValueError: 
    126126        return force_unicode(f) 
    127     m = f - int(f) 
     127    try: 
     128        m = f - int(f) 
     129    except OverflowError: 
     130        return force_unicode(f) 
    128131    if not m and d < 0: 
    129132        return mark_safe(u'%d' % int(f))