Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1684 closed enhancement (fixed)

[patch] Built-in "numerize" filter

Reported by: ubernostrum 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

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 ubernostrum 10 years ago.
patch against magic-removal to add 'numerize' filter
defaultfilters.2.diff (925 bytes) - added by ubernostrum 10 years ago.
No code change, but this one follows convention of referring to the arg as 'value'
defaultfilters.3.diff (927 bytes) - added by ubernostrum 10 years ago.
Yup. 'value'

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by ubernostrum

patch against magic-removal to add 'numerize' filter

comment:1 Changed 10 years ago by ubernostrum

  • Summary changed from Built-in "numerize" filter to [patch] Built-in "numerize" filter

comment:2 Changed 10 years ago by adrian

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.

Changed 10 years ago by ubernostrum

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

Changed 10 years ago by ubernostrum

Yup. 'value'

comment:3 Changed 10 years ago by adrian

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

(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