Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#687 closed defect (fixed)

[patch] floatformat broken

Reported by: Sune Kirkeby <sune.kirkeby@…> Owned by: adrian
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

floatformat is badly broken (I think after {581}). Here is the output from a few doctests I just whipped up:

**********************************************************************
File "tests/othertests/defaultfilters.py", line 4, in __main__
Failed example:
    floatformat(7.0, None)
Expected:
    '7'
Got:
    7.0
**********************************************************************
File "tests/othertests/defaultfilters.py", line 8, in __main__
Failed example:
    floatformat(0.07, None)
Expected:
    '0.1'
Got:
    0.070000000000000007
**********************************************************************
File "tests/othertests/defaultfilters.py", line 10, in __main__
Failed example:
    floatformat(0.007, None)
Expected:
    '0.0'
Got:
    0.0070000000000000001
**********************************************************************
File "tests/othertests/defaultfilters.py", line 12, in __main__
Failed example:
    floatformat(0.0, None)
Expected:
    '0'
Got:
    ''

Attachments (1)

floatformat.patch (3.0 KB) - added by Sune Kirkeby <sune.kirkeby@…> 10 years ago.

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by Sune Kirkeby <sune.kirkeby@…>

comment:1 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1007]) Fixed #687 -- Fixed bug in floatformat template filter and added unit tests. Thanks, Sune

Note: See TracTickets for help on using tickets.
Back to Top