Skip to content

Commit 16b2e4b

Browse files
committed
Docs for PercentType disable/customize percent character
1 parent 1bfe282 commit 16b2e4b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

reference/forms/types/percent.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ percentage data. If your percentage data is stored as a decimal (e.g. ``0.95``),
99
you can use this field out-of-the-box. If you store your data as a number
1010
(e.g. ``95``), you should set the ``type`` option to ``integer``.
1111

12-
This field adds a percentage sign "``%``" after the input box.
12+
When ``symbol`` is true, the field will add a percentage sign "``%``" after the
13+
input.
1314

1415
+-------------+-----------------------------------------------------------------------+
1516
| Rendered as | ``input`` ``text`` field |
1617
+-------------+-----------------------------------------------------------------------+
1718
| Options | - `scale`_ |
19+
| | - `symbol`_ |
1820
| | - `type`_ |
1921
+-------------+-----------------------------------------------------------------------+
2022
| Overridden | - `compound`_ |
@@ -54,6 +56,20 @@ scale
5456
By default, the input numbers are rounded. To allow for more decimal places,
5557
use this option.
5658

59+
symbol
60+
~~~~~~
61+
62+
**type**: ``boolean`` or ``string`` **default**: ``true``
63+
64+
.. versionadded:: 4.3
65+
66+
The ``symbol`` option was introduced in Symfony 4.3.
67+
68+
By default, fields are rendered with a percentage sign ``%`` after the input.
69+
Setting the value to ``false`` will not display the percentage sign.
70+
Setting the value to a ``string`` (e.g. ````), will show the string value instead
71+
of the default ``%`` sign.
72+
5773
type
5874
~~~~
5975

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy