<commit_before>===========================
``django.contrib.humanize``
===========================

.. module:: django.contrib.humanize
   :synopsis: A set of Django template filters useful for adding a "human
              touch" to data.

A set of Django template filters useful for adding a "human touch" to data.

To activate these filters, add ``'django.contrib.humanize'`` to your
:setting:`INSTALLED_APPS` setting. Once you've done that, use
``{% load humanize %}`` in a template, and you'll have access to the following
filters.

.. templatefilter:: apnumber

``apnumber``
============

For numbers 1-9, returns the number spelled out. Otherwise, returns the
number. This follows Associated Press style.

Examples:

* ``1`` becomes ``one``.
* ``2`` becomes ``two``.
* ``10`` becomes ``10``.

You can pass in either an integer or a string representation of an integer.

.. templatefilter:: intcomma

``intcomma``
============

Converts an integer to a string containing commas every three digits.

Examples:

* ``4500`` becomes ``4,500``.
* ``45000`` becomes ``45,000``.
* ``450000`` becomes ``450,000``.
* ``4500000`` becomes ``4,500,000``.

:doc:`/topics/i18n/formatting` will be respected if enabled,
e.g. with the ``'de'`` language:

* ``45000`` becomes ``'45.000'``.
* ``450000`` becomes ``'450.000'``.

You can pass in either an integer or a string representation of an integer.

.. templatefilter:: intword

``intword``
===========

Converts a large integer to a friendly text representation. Works best for
numbers over 1 million.

Examples:

* ``1000000`` becomes ``1.0 million``.
* ``1200000`` becomes ``1.2 million``.
* ``1200000000`` becomes ``1.2 billion``.

Values up to 10^100 (Googol) are supported.

:doc:`/topics/i18n/formatting` will be respected if enabled,
e.g. with the ``'de'`` language:

* ``1000000`` becomes ``'1,0 Million'``.
* ``1200000`` becomes ``'1,2 Million'``.
* ``1200000000`` becomes ``'1,2 Milliarden'``.

You can pass in either an integer or a string representation of an integer.

.. templatefilter:: naturalday

``naturalday``
==============

For dates that are the current day or within one day, return "today",
"tomorrow" or "yesterday", as appropriate. Otherwise, format the date using
the passed in format string.

**Argument:** Date formatting string as described in the :tfilter:`date` tag.<commit_msg>Fixed #27652 -- Doc'd that intcomma works with floats.<commit_after>===========================
``django.contrib.humanize``
===========================

.. module:: django.contrib.humanize
   :synopsis: A set of Django template filters useful for adding a "human
              touch" to data.

A set of Django template filters useful for adding a "human touch" to data.

To activate these filters, add ``'django.contrib.humanize'`` to your
:setting:`INSTALLED_APPS` setting. Once you've done that, use
``{% load humanize %}`` in a template, and you'll have access to the following
filters.

.. templatefilter:: apnumber

``apnumber``
============

For numbers 1-9, returns the number spelled out. Otherwise, returns the
number. This follows Associated Press style.

Examples:

* ``1`` becomes ``one``.
* ``2`` becomes ``two``.
* ``10`` becomes ``10``.

You can pass in either an integer or a string representation of an integer.

.. templatefilter:: intcomma

``intcomma``
============

Converts an integer or float (or a string representation of either) to a string
containing commas every three digits.

Examples:

* ``4500`` becomes ``4,500``.
* ``4500.2`` becomes ``4,500.2``.
* ``45000`` becomes ``45,000``.
* ``450000`` becomes ``450,000``.
* ``4500000`` becomes ``4,500,000``.

:doc:`/topics/i18n/formatting` will be respected if enabled,
e.g. with the ``'de'`` language:

* ``45000`` becomes ``'45.000'``.
* ``450000`` becomes ``'450.000'``.

.. templatefilter:: intword

``intword``
===========

Converts a large integer (or a string representation of an integer) to a
friendly text representation. Works best for numbers over 1 million.

Examples:

* ``1000000`` becomes ``1.0 million``.
* ``1200000`` becomes ``1.2 million``.
* ``1200000000`` becomes ``1.2 billion``.

Values up to 10^100 (Googol) are supported.

:doc:`/topics/i18n/formatting` will be respected if enabled,
e.g. with the ``'de'`` language:

* ``1000000`` becomes ``'1,0 Million'``.
* ``1200000`` becomes ``'1,2 Million'``.
* ``1200000000`` becomes ``'1,2 Milliarden'``.

.. templatefilter:: naturalday

``naturalday``
==============

For dates that are the current day or within one day, return "today",
"tomorrow" or "yesterday", as appropriate. Otherwise, format the date using
the passed in format string.

**Argument:** Date formatting string as described in the :tfilter:`date` tag.
{'fraction_non_alphanumeric': 0.18771186440677967, 'fraction_numerical': 0.06419491525423729, 'mean_word_length': 4.6471291866028706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691246', 'n_tokens_mistral': 1637, 'n_tokens_neox': 1405, 'n_words': 556}