Skip to content

Commit 60b6160

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 #16254 X-original-commit: 854a61d Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com> Signed-off-by: Arnaud Sibille (arsi) <arsi@odoo.com>
1 parent 972a24e commit 60b6160

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

content/developer/reference/frontend/javascript_reference.rst

Lines changed: 14 additions & 4 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,14 +623,24 @@ 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
- `hide_trailing_zeros`: hide zeros to the right of the last non-zero digit,
629639
e.g. `1.20` becomes `1.2` (`false` by default).
630640

631641
.. code-block:: xml
632642
633-
<field name="int_value" options="{'hide_trailing_zeros': true}" />
643+
<field name="float_value" options="{'hide_trailing_zeros': true}" />
634644
635645
Time (`float_time`)
636646
The goal of this widget is to display properly a float value that represents

0 commit comments

Comments
 (0)