Skip to Content
āđ€āļĄāļ™āļđ
āļ„āļļāļ“āļ•āđ‰āļ­āļ‡āļĨāļ‡āļ—āļ°āđ€āļšāļĩāļĒāļ™āđ€āļžāļ·āđˆāļ­āđ‚āļ•āđ‰āļ•āļ­āļšāļāļąāļšāļ„āļ­āļĄāļĄāļđāļ™āļīāļ•āļĩāđ‰
āļ„āļģāļ–āļēāļĄāļ™āļĩāđ‰āļ–āļđāļāļ•āļąāđ‰āļ‡āļ„āđˆāļēāļŠāļ–āļēāļ™āļ°
1 āļ•āļ­āļšāļāļĨāļąāļš
601 āļĄāļļāļĄāļĄāļ­āļ‡

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
909
1
āļĄāļī.āļĒ. 25
835
0
āļž.āļĒ. 24
1126
2
āļ.āļ„. 25
492
0
āļ•.āļ„. 24
960