Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1684 closed enhancement (fixed)

[patch] Built-in "numerize" filter

Reported by: James Bennett 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

It'd be handy to have a template filter which follows AP style guidelines for numbers -- if the number is 1-9, spell it out, otherwise print the number as digits.

Attachments (3)

defaultfilters.diff (917 bytes ) - added by James Bennett 18 years ago.
patch against magic-removal to add 'numerize' filter
defaultfilters.2.diff (925 bytes ) - added by James Bennett 18 years ago.
No code change, but this one follows convention of referring to the arg as 'value'
defaultfilters.3.diff (927 bytes ) - added by James Bennett 18 years ago.
Yup. 'value'

Download all attachments as: .zip

Change History (6)

by James Bennett, 18 years ago

Attachment: defaultfilters.diff added

patch against magic-removal to add 'numerize' filter

comment:1 by James Bennett, 18 years ago

Summary: Built-in "numerize" filter[patch] Built-in "numerize" filter

comment:2 by Adrian Holovaty, 18 years ago

Rather than putting this in the default filters, we could add django.contrib.apstyle and fill it with other AP-isms like dateline-related stuff.

by James Bennett, 18 years ago

Attachment: defaultfilters.2.diff added

No code change, but this one follows convention of referring to the arg as 'value'

by James Bennett, 18 years ago

Attachment: defaultfilters.3.diff added

Yup. 'value'

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [3077]) Fixed #1684 -- Added apnumber template filter in django.contrib.humanize. Thanks, ubernostrum

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