Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 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 8 years ago.
patch against magic-removal to add 'numerize' filter
defaultfilters.2.diff (925 bytes) - added by ubernostrum 8 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 8 years ago.
Yup. 'value'

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by ubernostrum

patch against magic-removal to add 'numerize' filter

comment:1 Changed 8 years ago by ubernostrum

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

comment:2 Changed 8 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 8 years ago by ubernostrum

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

Changed 8 years ago by ubernostrum

Yup. 'value'

comment:3 Changed 8 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.