Django

Code

Ticket #6030: floatformat.diff

File floatformat.diff, 0.8 kB (added by SmileyChris, 1 year ago)
  • tests/regressiontests/defaultfilters/tests.py

    old new  
    3737u'13.1031' 
    3838>>> floatformat(u'foo', u'bar') 
    3939u'' 
     40>>> floatformat(None) 
     41u'' 
    4042 
    4143>>> addslashes(u'"double quotes" and \'single quotes\'') 
    4244u'\\"double quotes\\" and \\\'single quotes\\\'' 
  • django/template/defaultfilters.py

    old new  
    8989    """ 
    9090    try: 
    9191        f = float(text) 
    92     except ValueError
     92    except (ValueError, TypeError)
    9393        return u'' 
    9494    try: 
    9595        d = int(arg)