8000 Docs for PercentType disable/customize percent character by OskarStark · Pull Request #11078 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Docs for PercentType disable/customize percent character #11078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
18 changes: 17 additions & 1 deletion reference/forms/types/percent.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ percentage data. If your percentage data is stored as a decimal (e.g. ``0.95``),
you can use this field out-of-the-box. If you store your data as a number
(e.g. ``95``), you should set the ``type`` option to ``integer``.

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

+-------------+-----------------------------------------------------------------------+
| Rendered as | ``input`` ``text`` field |
+-------------+-----------------------------------------------------------------------+
| Options | - `scale`_ |
| | - `symbol`_ |
| | - `type`_ |
+-------------+-----------------------------------------------------------------------+
| Overridden | - `compound`_ |
Expand Down Expand Up @@ -54,6 +56,20 @@ scale
By default, the input numbers are rounded. To allow for more decimal places,
use this option.

symbol
~~~~~~

**type**: ``boolean`` or ``string`` **default**: ``true``

.. versionadded:: 4.3

The ``symbol`` option was introduced in Symfony 4.3.

By default, fields are rendered with a percentage sign ``%`` after the input.
Setting the value to ``false`` will not display the percentage sign.
Setting the value to a ``string`` (e.g. ``‱``), will show the string value instead
of the default ``%`` sign.

type
~~~~

Expand Down
0