#3017 closed enhancement (fixed)
[patch] unit tests showing humanize intcomma handling floats
Reported by: | Chris Beaven | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Contrib apps | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The intcomma
filter should handle floats, too.
Of course, the name doesn't make much sense in that case, so I have renamed to commaseparate
(while keeping backwards compatibility).
Attachments (3)
Change History (11)
by , 18 years ago
Attachment: | commaseparate.patch added |
---|
comment:1 by , 18 years ago
by , 18 years ago
Attachment: | commaseparate.2.patch added |
---|
comment:2 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:3 by , 18 years ago
I'm going to leave this one until after 0.96 (which will be "real soon now"), just to avoid any confusion with the renaming change (I realise this is backwards compatible; good thinking there). Between 0.96 and 1.0, the list of things people will have to look out for will grow and we'll include this in that.
comment:4 by , 18 years ago
Triage Stage: | Ready for checkin → Design decision needed |
---|
Are you sure this change is required? I added a unit test for float separation (diff attached), and it worked fine as-is.
Can you provide a specific test case where the existing intcomma filter fails for floats?
comment:5 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I'm quite confused also - I can see the current method works perfectly with floats so I'm not sure why I even wrote this patch.
comment:6 by , 18 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Summary: | [patch] Humanize intcomma should handle floats → [patch] unit tests showing humanize intcomma handling floats |
Triage Stage: | Design decision needed → Ready for checkin |
Actually, the unit test may as well go in there. I opened a new ticket regarding renaming the filter to something more sane: #3884
comment:7 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:8 by , 18 years ago
Russell: I changed one of the tests (the one with a long float) before committing, because it was vulnerable to internal floating-point representation problems. I only caught it because it failed for me.
On a related side note, there's one spelling mistake in a docstring somewhere which misspells separate as "seperate".
I can't be bothered opening a ticket for something that negligible, but feel free to fix it as part of this one ;)