From a6f03bd5c1b246d4d3f5d070897ab838c8be79ac Mon Sep 17 00:00:00 2001 From: Nami-Doc Date: Sun, 15 Jul 2012 14:50:43 +0300 Subject: [PATCH] Reverse argument for number_format --- doc/filters/number_format.rst | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/filters/number_format.rst b/doc/filters/number_format.rst index ccc8f2f..7b4fe0a 100644 --- a/doc/filters/number_format.rst +++ b/doc/filters/number_format.rst @@ -16,12 +16,12 @@ separator using the additional arguments: .. 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 options of: -- 0 decimal places. +- 2 decimal places. - ``.`` as the decimal point. - ``,`` as the thousands separator. @@ -30,7 +30,7 @@ These defaults can be easily changed through the core extension: .. code-block:: php $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 additional parameters. -- 1.7.2.5