Search code examples
python-2.7odoo-8

How can i change the decimal precision and cancel the rounding of float numbers


I'm using odoo 8 and i imported an excel file which i introduced float values with 3 digits after the decimal point. After importing the data in odoo 8 as a tree view i noticed that odoo only displays 2 digits after the comma for these digits and it does the rounding however i want to keep the values as is in the excel file (without rounding and with 3 digits after the decimal point). Any idea for help please ?enter image description here


Solution

  • You need to change the decimal precision using digits.

    digits=(6, 2) specifies the precision of a float number: 6 is the total number of digits, while 2 is the number of digits after the comma. Note that it results in the number digits before the comma is a maximum 4