From d5d0bf5f52a4cc3adf7b4a58a6afd18478fb8bac Mon Sep 17 00:00:00 2001 From: Benoit Duffez Date: Wed, 4 Apr 2018 17:06:47 +0200 Subject: [PATCH 1/2] set default scale value to 0 see https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php#L35 --- reference/forms/types/options/scale.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/scale.rst.inc b/reference/forms/types/options/scale.rst.inc index 49d038bc686..5b7af69123e 100644 --- a/reference/forms/types/options/scale.rst.inc +++ b/reference/forms/types/options/scale.rst.inc @@ -1,7 +1,7 @@ scale ~~~~~ -**type**: ``integer`` **default**: Locale-specific (usually around ``3``) +**type**: ``integer`` **default**: ``0``. Any other value is ignored. This specifies how many decimals will be allowed until the field rounds the submitted value (via ``rounding_mode``). For example, if ``scale`` is set From 1783ed95151d9f1a4a92ccab8d3020921ee3c210 Mon Sep 17 00:00:00 2001 From: Benoit Duffez Date: Wed, 4 Apr 2018 17:43:43 +0200 Subject: [PATCH 2/2] reverted the edit on scale.rst; removed inclusion in integer.rst As pointed out in the comments of symfony/symfony-docs/pull/9549, the scale.rst.inc file is included twice: once in integer.rst (the goal of the PR) and once in number.rst. number.rst should not see this edit as its scale parameter is not ignored. Hence, the inclusion was removed from integer.rst and the edit was made. number.rst is now identical to base ref. --- reference/forms/types/integer.rst | 10 +++++++++- reference/forms/types/options/scale.rst.inc | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index 1b87d8f690e..60e8ae3d312 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -46,7 +46,15 @@ Field Options .. include:: /reference/forms/types/options/grouping.rst.inc -.. include:: /reference/forms/types/options/scale.rst.inc +scale +~~~~~ + +**type**: ``integer`` **default**: ``0``. Any other value is ignored. + +This specifies how many decimals will be allowed until the field rounds +the submitted value (via ``rounding_mode``). For example, if ``scale`` is set +to ``2``, a submitted value of ``20.123`` will be rounded to, for example, +``20.12`` (depending on your `rounding_mode`_). rounding_mode ~~~~~~~~~~~~~ diff --git a/reference/forms/types/options/scale.rst.inc b/reference/forms/types/options/scale.rst.inc index 5b7af69123e..49d038bc686 100644 --- a/reference/forms/types/options/scale.rst.inc +++ b/reference/forms/types/options/scale.rst.inc @@ -1,7 +1,7 @@ scale ~~~~~ -**type**: ``integer`` **default**: ``0``. Any other value is ignored. +**type**: ``integer`` **default**: Locale-specific (usually around ``3``) This specifies how many decimals will be allowed until the field rounds the submitted value (via ``rounding_mode``). For example, if ``scale`` is set