Skip to content

Commit 945b3f0

Browse files
[Form] add "model_type" option to MoneyType
1 parent ed1f530 commit 945b3f0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

reference/forms/types/money.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ If set to ``true``, the HTML input will be rendered as a native HTML5
7676

7777
As HTML5 number format is normalized, it is incompatible with ``grouping`` option.
7878

79+
model_type
80+
~~~~~
81+
82+
**type**: ``string`` **default**: ``float``
83+
84+
If set to ``integer``, the value will be converted to an ``integer``.
85+
86+
.. caution::
87+
88+
When the value is set to ``integer``, the ``divisor`` option must not be set to ``1``,
89+
to avoid losing decimals during the casting.
90+
91+
.. versionadded:: 7.1
92+
93+
The ``model_type`` option was introduced in Symfony 7.1.
94+
7995
scale
8096
~~~~~
8197

0 commit comments

Comments
 (0)