Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#687 closed defect (fixed)

[patch] floatformat broken

Reported by: Sune Kirkeby <sune.kirkeby@…> Owned by: Adrian Holovaty
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: no UI/UX: no

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@…> 19 years ago.

Download all attachments as: .zip

Change History (2)

by Sune Kirkeby <sune.kirkeby@…>, 19 years ago

Attachment: floatformat.patch added

comment:1 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(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