Skip to content

Commit 6490cee

Browse files
committed
minor #9542 [Form] Removed Integer scale option (dlabouesse)
This PR was squashed before being merged into the 2.7 branch (closes #9542). Discussion ---------- [Form] Removed Integer scale option Scale option is hardcoded for IntegerType. These changes result from the discussion introduced by symfony/symfony#26734. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 2f61f75 [Form] Removed Integer scale option
2 parents d5946c0 + 2f61f75 commit 6490cee

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

reference/forms/types/integer.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
1717
| Rendered as | ``input`` ``number`` field |
1818
+-------------+-----------------------------------------------------------------------+
1919
| Options | - `grouping`_ |
20-
| | - `scale`_ |
2120
| | - `rounding_mode`_ |
2221
+-------------+-----------------------------------------------------------------------+
2322
| Overridden | - `compound`_ |
24-
| options | |
23+
| options | - `scale`_ |
2524
+-------------+-----------------------------------------------------------------------+
2625
| Inherited | - `data`_ |
2726
| options | - `disabled`_ |
@@ -47,8 +46,6 @@ Field Options
4746

4847
.. include:: /reference/forms/types/options/grouping.rst.inc
4948

50-
.. include:: /reference/forms/types/options/scale.rst.inc
51-
5249
rounding_mode
5350
~~~~~~~~~~~~~
5451

@@ -83,6 +80,13 @@ Overridden Options
8380

8481
.. include:: /reference/forms/types/options/compound_type.rst.inc
8582

83+
scale
84+
~~~~~
85+
86+
**type**: ``integer`` **default**: ``0``
87+
88+
This specifies how many decimals will be allowed until the field rounds the submitted value (via ``rounding_mode``). This option inherits from :doc:`number </reference/forms/types/number>` type and is overriden to ``0`` for ``IntegerType``.
89+
8690
Inherited Options
8791
-----------------
8892

reference/forms/types/number.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,19 @@ Field Options
4242

4343
.. include:: /reference/forms/types/options/grouping.rst.inc
4444

45-
.. include:: /reference/forms/types/options/scale.rst.inc
45+
scale
46+
~~~~~
47+
48+
.. versionadded:: 2.7
49+
The ``scale`` option was introduced in Symfony 2.7. Prior to Symfony 2.7,
50+
it was known as ``precision``.
51+
52+
**type**: ``integer`` **default**: Locale-specific (usually around ``3``)
53+
54+
This specifies how many decimals will be allowed until the field rounds
55+
the submitted value (via ``rounding_mode``). For example, if ``scale`` is set
56+
to ``2``, a submitted value of ``20.123`` will be rounded to, for example,
57+
``20.12`` (depending on your `rounding_mode`_).
4658

4759
rounding_mode
4860
~~~~~~~~~~~~~

reference/forms/types/options/scale.rst.inc

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)