跳至內容
選單
此問題已被標幟

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 ?

相關帖文 回覆 瀏覽次數 活動
1
6月 25
528
1
6月 25
495
0
11月 24
924
0
10月 24
775
2
6月 25
1280