Skip to content

Commit 682bc96

Browse files
[IMP] javascript reference: add min_display_digits option
odoo/enterprise#104728 added a `min_display_digits` option on float fields. This commit adds it also in the documentation. closes #16201 Related: odoo/odoo#246347 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
1 parent b95916c commit 682bc96

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

content/developer/reference/frontend/javascript_reference.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,14 @@ Float (`float`)
607607

608608
.. code-block:: xml
609609
610-
<field name="int_value" options="{'type': 'number'}" />
610+
<field name="float_value" options="{'type': 'number'}" />
611611
612612
- `step`: set the step to the value up and down when the user click on buttons
613613
(only for input of type number, `1` by default)
614614

615615
.. code-block:: xml
616616
617-
<field name="int_value" options="{'type': 'number', 'step': 0.1}" />
617+
<field name="float_value" options="{'type': 'number', 'step': 0.1}" />
618618
619619
- `format`: should the number be formatted. (`true` by default)
620620

@@ -623,7 +623,17 @@ Float (`float`)
623623

624624
.. code-block:: xml
625625
626-
<field name="int_value" options="{'format': false}" />
626+
<field name="float_value" options="{'format': false}" />
627+
628+
- `min_display_digits`: The minimum number of decimal digits to display.
629+
630+
For example, if set to 3 and no decimal precision is provided:
631+
`1.2` becomes `"1.200"`, `1.123` becomes `"1.123"` and `1.1234` becomes `"1.1234"`.
632+
633+
.. code-block:: xml
634+
635+
<field name="float_value" options="{'min_display_digits': 3}" />
636+
627637
628638
Time (`float_time`)
629639
The goal of this widget is to display properly a float value that represents

0 commit comments

Comments
 (0)