Ticket #6030: floatformat.diff

File floatformat.diff, 849 bytes (added by Chris Beaven, 17 years ago)
  • tests/regressiontests/defaultfilters/tests.py

     
    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

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