mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 21:37:29 +00:00
Reverse argument for number_format
This commit is contained in:
@@ -16,12 +16,12 @@ separator using the additional arguments:
|
|||||||
|
|
||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
{{ 9800.333|number_format(2, ',', '.') }}
|
{{ 9800.333|number_format(2, '.', ',') }}
|
||||||
|
|
||||||
If no formatting options are provided then Twig will use the default formatting
|
If no formatting options are provided then Twig will use the default formatting
|
||||||
options of:
|
options of:
|
||||||
|
|
||||||
- 0 decimal places.
|
- 2 decimal places.
|
||||||
- ``.`` as the decimal point.
|
- ``.`` as the decimal point.
|
||||||
- ``,`` as the thousands separator.
|
- ``,`` as the thousands separator.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ These defaults can be easily changed through the core extension:
|
|||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
$twig = new Twig_Environment($loader);
|
$twig = new Twig_Environment($loader);
|
||||||
$twig->getExtension('core')->setNumberFormat(3, ',', '.');
|
$twig->getExtension('core')->setNumberFormat(3, '.', ',');
|
||||||
|
|
||||||
The defaults set for ``number_format`` can be over-ridden upon each call using the
|
The defaults set for ``number_format`` can be over-ridden upon each call using the
|
||||||
additional parameters.
|
additional parameters.
|
||||||
|
|||||||
Reference in New Issue
Block a user