Skip to content

Commit 22e5697

Browse files
authored
[Form] Removed Integer rounding-related options
Scale and roundingMode options are hardcoded for IntegerType. These changes result from the discussion introduced by symfony/symfony#26734.
1 parent 6f3e0c4 commit 22e5697

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

reference/forms/types/integer.rst

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ good at handling data that's in an integer form. The input ``number`` field
99
looks like a text box, except that - if the user's browser supports HTML5
1010
- it will have some extra front-end functionality.
1111

12-
This field has different options on how to handle input values that aren't
13-
integers. By default, all non-integer values (e.g. 6.78) will round down
14-
(e.g. 6).
15-
1612
+-------------+-----------------------------------------------------------------------+
1713
| Rendered as | ``input`` ``number`` field |
1814
+-------------+-----------------------------------------------------------------------+
1915
| Options | - `grouping`_ |
20-
| | - `scale`_ |
21-
| | - `rounding_mode`_ |
2216
+-------------+-----------------------------------------------------------------------+
2317
| Overridden | - `compound`_ |
2418
| options | |
@@ -47,37 +41,6 @@ Field Options
4741

4842
.. include:: /reference/forms/types/options/grouping.rst.inc
4943

50-
.. include:: /reference/forms/types/options/scale.rst.inc
51-
52-
rounding_mode
53-
~~~~~~~~~~~~~
54-
55-
**type**: ``integer`` **default**: ``IntegerToLocalizedStringTransformer::ROUND_DOWN``
56-
57-
By default, if the user enters a non-integer number, it will be rounded
58-
down. There are several other rounding methods and each is a constant
59-
on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\IntegerToLocalizedStringTransformer`:
60-
61-
* ``IntegerToLocalizedStringTransformer::ROUND_DOWN`` Round towards zero.
62-
63-
* ``IntegerToLocalizedStringTransformer::ROUND_FLOOR`` Round towards negative
64-
infinity.
65-
66-
* ``IntegerToLocalizedStringTransformer::ROUND_UP`` Round away from zero.
67-
68-
* ``IntegerToLocalizedStringTransformer::ROUND_CEILING`` Round towards
69-
positive infinity.
70-
71-
* ``IntegerToLocalizedStringTransformer::ROUND_HALF_DOWN`` Round towards the
72-
"nearest neighbor". If both neighbors are equidistant, round down.
73-
74-
* ``IntegerToLocalizedStringTransformer::ROUND_HALF_EVEN`` Round towards the
75-
"nearest neighbor". If both neighbors are equidistant, round towards the
76-
even neighbor.
77-
78-
* ``IntegerToLocalizedStringTransformer::ROUND_HALF_UP`` Round towards the
79-
"nearest neighbor". If both neighbors are equidistant, round up.
80-
8144
Overridden Options
8245
------------------
8346

0 commit comments

Comments
 (0)