Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
344 Visualizzazioni

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 !

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Autore

Will it work with monetary field type ?

Post correlati Risposte Visualizzazioni Attività
1
giu 25
559
1
giu 25
522
0
nov 24
960
0
ott 24
785
2
giu 25
1302