diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 3fad6c65e52..c5db2c7b092 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -13,6 +13,7 @@ that you want to use for your number. +-------------+----------------------------------------------------------------------+ | Options | - `grouping`_ | | | - `html5`_ | +| | - `input`_ | | | - `scale`_ | | | - `rounding_mode`_ | +-------------+----------------------------------------------------------------------+ @@ -59,6 +60,21 @@ html5 If set to ``true``, the HTML input will be rendered as a native HTML5 ``type="number"`` form. +input +~~~~~ + +**type**: ``string`` **default**: ``number`` + +.. versionadded:: 4.3 + + The ``input`` option was introduced in Symfony 4.3. + +The format of the input data - i.e. the format that the number is stored on +your underlying object. Valid values are ``number`` and ``string``. Setting +this option to ``string`` can be useful if the underlying data is a string +for precision reasons (for example, Doctrine uses strings for the ``decimal`` +type). + scale ~~~~~