Requires {% load humanize %}
Add {% load humanize %} near the top of any template that
uses |apnumber. Without it Django does not
know the name and raises TemplateSyntaxError.
{% load humanize %} only works when
"django.contrib.humanize" is in your
INSTALLED_APPS — the load fails before the
library is ever reached.
Follows the Associated Press style rule for numbers in prose: spell out one through nine, use figures for 10 and above.
Template
{% load humanize %}
<p>{{ 3|apnumber }} comments</p>
<p>{{ 42|apnumber }} comments</p>
Result
<p>three comments</p> <p>42 comments</p>
Values outside one through nine are returned unchanged, so it is safe to apply to a whole column of numbers.
