Skip to Content
Menu
This question has been flagged
2 Replies
1855 Views

Example:  I enter the cost for a product (db field 'standard_price') as 3.31 and it works fine.  Database stores the value '3.31'.  Now if I change the product cost to 3.32 I see the value 3.3200000000000003 in db 'standard_price' field, but the product webpage displays 3.32.  Why the discrepancy?  Also, I sometimes see similar long decimal values on certain reports.  I have not messed with any currency or UoM settings so I'm not sure why this might be happening.  Thanks for any input to explain this.

version: odoo community 10

Avatar
Discard

Hello, excuse could you solve the problem?

Author Best Answer

I double checked the decimal precision and everything is 2-3 digits.  And I'm still not sure why odoo would randomly add .0000000000000003 to my specified product cost, even if there was a problem with decimals/rounding.  The accounting/reports of the system still seems ok for the most part, buy it's problematic because if I directly access products with API I have to round all the numbers coming out of the DB.  (ie: 3.3200000000000003 > 3.32)


Avatar
Discard
Best Answer

You have to configure the decimal precision on odoo general settings. This link will help you

https://www.odoo.com/forum/help-1/question/how-to-change-products-cost-decimal-precision-1299

Avatar
Discard