1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #31363 -- Added support for negative integers to intword template filter.

This commit is contained in:
jay20162016
2020-03-14 12:32:19 -04:00
committed by Mariusz Felisiak
parent 3857a08bdb
commit 924c01ba09
4 changed files with 39 additions and 11 deletions

View File

@@ -66,6 +66,7 @@ Examples:
* ``1000000`` becomes ``1.0 million``.
* ``1200000`` becomes ``1.2 million``.
* ``1200000000`` becomes ``1.2 billion``.
* ``-1200000000`` becomes ``-1.2 billion``.
Values up to 10^100 (Googol) are supported.
@@ -75,12 +76,17 @@ e.g. with the ``'de'`` language:
* ``1000000`` becomes ``'1,0 Million'``.
* ``1200000`` becomes ``'1,2 Millionen'``.
* ``1200000000`` becomes ``'1,2 Milliarden'``.
* ``-1200000000`` becomes ``'-1,2 Milliarden'``.
.. versionchanged:: 3.0
All numeric values are now translated as plural, except ``1.0`` which is
translated as a singular phrase. This may be incorrect for some languages.
.. versionchanged:: 3.1
Support for negative integers was added.
.. templatefilter:: naturalday
``naturalday``