如何更改小数精度并取消浮点数的舍入
How can i change the decimal precision and cancel the rounding of float numbers
我正在使用 odoo 8,我导入了一个 excel 文件,我在该文件中引入了小数点后 3 位的浮点值。在 odoo 8 中将数据导入为树视图后,我注意到 odoo 只在这些数字的逗号后显示 2 位数字,并且它会进行舍入但是我想保持 excel 文件中的值(没有舍入并保留小数点后 3 位)。有什么帮助吗?
您需要使用 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
我正在使用 odoo 8,我导入了一个 excel 文件,我在该文件中引入了小数点后 3 位的浮点值。在 odoo 8 中将数据导入为树视图后,我注意到 odoo 只在这些数字的逗号后显示 2 位数字,并且它会进行舍入但是我想保持 excel 文件中的值(没有舍入并保留小数点后 3 位)。有什么帮助吗?
您需要使用 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