diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-08 08:37:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 08:37:27 +0200 |
| commit | 4a43335d300da942602fbf216cd0a53b60827ab4 (patch) | |
| tree | 0fa559e6c92066934e0c79cada2293b986e56e29 /docs/ref | |
| parent | 301a85a12f3c2c9427c7ff581fd4683bab1f29f6 (diff) | |
Fixed #30086, Refs #32873 -- Made floatformat template filter independent of USE_L10N.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 936c80cdb5..baf0608a40 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1736,6 +1736,18 @@ example, when the active locale is ``en`` (English): ``34232.00`` ``{{ value|floatformat:"-3g" }}`` ``34,232`` ============ ================================= ============= +Output is always localized (independently of the :ttag:`{% localize off %} +<localize>` tag) unless the argument passed to ``floatformat`` has the ``u`` +suffix, which will force disabling localization. For example, when the active +locale is ``pl`` (Polish): + +============ ================================= ============= +``value`` Template Output +============ ================================= ============= +``34.23234`` ``{{ value|floatformat:"3" }}`` ``34,232`` +``34.23234`` ``{{ value|floatformat:"3u" }}`` ``34.232`` +============ ================================= ============= + Using ``floatformat`` with no argument is equivalent to using ``floatformat`` with an argument of ``-1``. @@ -1743,6 +1755,13 @@ with an argument of ``-1``. The ``g`` suffix to force grouping by thousand separators was added. +.. versionchanged:: 4.0 + + ``floatformat`` template filter no longer depends on the + :setting:`USE_L10N` setting and always returns localized output. + + The ``u`` suffix to force disabling localization was added. + .. templatefilter:: force_escape ``force_escape`` |
