8000 minor #9543 rounding_mode for money type (syastrebov) · symfony/symfony-docs@1af55e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1af55e6

Browse files
committed
minor #9543 rounding_mode for money type (syastrebov)
This PR was merged into the master branch. Discussion ---------- rounding_mode for money type Added docs for symfony/symfony#26767 Commits ------- 819d0a6 rounding_mode for money type
2 parents 9eda50b + 819d0a6 commit 1af55e6

File tree

3 files changed

+26
-28
lines changed

3 files changed

+26
-28
lines changed

reference/forms/types/money.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ how the input and output of the data is handled.
1717
| Options | - `currency`_ |
1818
| | - `divisor`_ |
1919
| | - `grouping`_ |
20+
| | - `rounding_mode`_ |
2021
| | - `scale`_ |
2122
+-------------+---------------------------------------------------------------------+
2223
| Overridden | - `compound`_ |
@@ -79,6 +80,8 @@ be set back on your object.
7980

8081
.. include:: /reference/forms/types/options/grouping.rst.inc
8182

83+
.. include:: /reference/forms/types/options/rounding_mode.rst.inc
84+
8285
scale
8386
~~~~~
8487

reference/forms/types/number.rst

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,7 @@ Field Options
4343

4444
.. include:: /reference/forms/types/options/scale.rst.inc
4545

46-
rounding_mode
47-
~~~~~~~~~~~~~
48-
49-
**type**: ``integer`` **default**: ``NumberToLocalizedStringTransformer::ROUND_HALF_UP``
50-
51-
If a submitted number needs to be rounded (based on the `scale`_
52-
option), you have several configurable options for that rounding. Each
53-
option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer`:
54-
55-
* ``NumberToLocalizedStringTransformer::ROUND_DOWN`` Round towards zero.
56-
57-
* ``NumberToLocalizedStringTransformer::ROUND_FLOOR`` Round towards negative
58-
infinity.
59-
60-
* ``NumberToLocalizedStringTransformer::ROUND_UP`` Round away from zero.
61-
62-
* ``NumberToLocalizedStringTransformer::ROUND_CEILING`` Round towards
63-
positive infinity.
64-
65-
* ``NumberToLocalizedStringTransformer::ROUND_HALF_DOWN`` Round towards the
66-
"nearest neighbor". If both neighbors are equidistant, round down.
67-
68-
* ``NumberToLocalizedStringTransformer::ROUND_HALF_EVEN`` Round towards the
69-
"nearest neighbor". If both neighbors are equidistant, round towards the
70-
even neighbor.
71-
72-
* ``NumberToLocalizedStringTransformer::ROUND_HALF_UP`` Round towards the
73-
"nearest neighbor". If both neighbors are equidistant, round up.
46+
.. include:: /reference/forms/types/options/rounding_mode.rst.inc
7447

7548
Overridden Options
7649
------------------
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
rounding_mode
2+
~~~~~~~~~~~~~
3+
4+
**type**: ``integer`` **default**: ``NumberToLocalizedStringTransformer::ROUND_HALF_UP``
5+
6+
If a submitted number needs to be rounded (based on the `scale`_
7+
option), you have several configurable options for that rounding. Each
8+
option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer`:
9+
10+
* ``NumberToLocalizedStringTransformer::ROUND_DOWN`` Round towards zero.
11+
12+
* ``NumberToLocalizedStringTransformer::ROUND_FLOOR`` Round towards negative infinity.
13+
14+
* ``NumberToLocalizedStringTransformer::ROUND_UP`` Round away from zero.
15+
16+
* ``NumberToLocalizedStringTransformer::ROUND_CEILING`` Round towards positive infinity.
17+
18+
* ``NumberToLocalizedStringTransformer::ROUND_HALF_DOWN`` Round towards the "nearest neighbor". If both neighbors are equidistant, round down.
19+
20+
* ``NumberToLocalizedStringTransformer::ROUND_HALF_EVEN`` Round towards the "nearest neighbor". If both neighbors are equidistant, round towards the even neighbor.
21+
22+
* ``NumberToLocalizedStringTransformer::ROUND_HALF_UP`` Round towards the "nearest neighbor". If both neighbors are equidistant, round up.

0 commit comments

Comments
 (0)
0