Ticket #14804: humanize-docs.diff

File humanize-docs.diff, 3.0 KB (added by Adam Vandenberg, 14 years ago)
  • docs/ref/contrib/humanize.txt

    diff --git a/docs/ref/contrib/humanize.txt b/docs/ref/contrib/humanize.txt
    index 17db3c2..22efac9 100644
    a b A set of Django template filters useful for adding a "human touch" to data.  
    1010
    1111To activate these filters, add ``'django.contrib.humanize'`` to your
    1212:setting:`INSTALLED_APPS` setting. Once you've done that, use
    13 ``{% load humanize %}`` in a template, and you'll have access to these filters:
     13``{% load humanize %}`` in a template, and you'll have access to the following
     14filters.
    1415
    1516apnumber
    1617--------
    number. This follows Associated Press style.  
    2021
    2122Examples:
    2223
    23     * ``1`` becomes ``'one'``.
    24     * ``2`` becomes ``'two'``.
     24    * ``1`` becomes ``one``.
     25    * ``2`` becomes ``two``.
    2526    * ``10`` becomes ``10``.
    2627
    2728You can pass in either an integer or a string representation of an integer.
    Converts an integer to a string containing commas every three digits.  
    3334
    3435Examples:
    3536
    36     * ``4500`` becomes ``'4,500'``.
    37     * ``45000`` becomes ``'45,000'``.
    38     * ``450000`` becomes ``'450,000'``.
    39     * ``4500000`` becomes ``'4,500,000'``.
     37    * ``4500`` becomes ``4,500``.
     38    * ``45000`` becomes ``45,000``.
     39    * ``450000`` becomes ``450,000``.
     40    * ``4500000`` becomes ``4,500,000``.
    4041
    4142You can pass in either an integer or a string representation of an integer.
    4243
    numbers over 1 million.  
    4849
    4950Examples:
    5051
    51     * ``1000000`` becomes ``'1.0 million'``.
    52     * ``1200000`` becomes ``'1.2 million'``.
    53     * ``1200000000`` becomes ``'1.2 billion'``.
     52    * ``1000000`` becomes ``1.0 million``.
     53    * ``1200000`` becomes ``1.2 million``.
     54    * ``1200000000`` becomes ``1.2 billion``.
    5455
    5556Values up to 1000000000000000 (one quadrillion) are supported.
    5657
    5758You can pass in either an integer or a string representation of an integer.
    5859
    59 ordinal
    60 -------
    61 
    62 Converts an integer to its ordinal as a string.
    63 
    64 Examples:
    65 
    66     * ``1`` becomes ``'1st'``.
    67     * ``2`` becomes ``'2nd'``.
    68     * ``3`` becomes ``'3rd'``.
    69 
    70 You can pass in either an integer or a string representation of an integer.
    71 
    7260naturalday
    7361----------
    7462
    For dates that are the current day or within one day, return "today",  
    7866"tomorrow" or "yesterday", as appropriate. Otherwise, format the date using
    7967the passed in format string.
    8068
    81 **Argument:** Date formatting string as described in the :ttag:`now` tag.
     69**Argument:** Date formatting string as described in the :ttag:`date` tag.
    8270
    8371Examples (when 'today' is 17 Feb 2007):
    8472
    Examples (when 'today' is 17 Feb 2007):  
    8775    * ``18 Feb 2007`` becomes ``tomorrow``.
    8876    * Any other day is formatted according to given argument or the
    8977      :setting:`DATE_FORMAT` setting if no argument is given.
     78
     79ordinal
     80-------
     81
     82Converts an integer to its ordinal as a string.
     83
     84Examples:
     85
     86    * ``1`` becomes ``1st``.
     87    * ``2`` becomes ``2nd``.
     88    * ``3`` becomes ``3rd``.
     89
     90You can pass in either an integer or a string representation of an integer.
Back to Top