Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
524 Переглядів

Hello Odoo experts 👋

  • I have a custom float field (e.g., price or rate)
  • I want it to display values with 3 decimal places, like 0.000
  • There is no Create button on the form — I’m just trying to change how an existing float field is displayed in the UI

Thanks in advance !

Аватар
Відмінити
Найкраща відповідь

Hi,


You can define the decimal precision while defining the field.

Try with the following code.

exchange_rate = fields.Float(string='Exchange.Rate', digits=(16, 3))

* You can change the precision from the UI.

Change the XML as 

<field name="field_name" digits="[3,3]"/>



Hope it helps

Аватар
Відмінити
Автор

Will it work with monetary field type ?

Related Posts Відповіді Переглядів Дія
1
черв. 25
767
1
черв. 25
714
0
лист. 24
1042
2
лип. 25
384
0
жовт. 24
887