Skip to Content
Menu
This question has been flagged
1843 Views

"The behavior of round() for floats can be surprising: for example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it’s a result of the fact that most decimal fractions can’t be represented exactly as a float. See Floating Point Arithmetic: Issues and Limitations for more information."
The above mentioned Floating point Arithmetic issue is annoying me,i need to correct this issue in base level so that i will get 2.675 as 2.68 if i type in any of the float field in odoo 10. 

Please dont share "https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/tests/test_float.py#L72V" i dont know what to do with this test_float.py
i want to edit the base code and need to effect entire odoo 10,so where ever i enter a float and the last digit is 5 in decimal then it should round up not round down (eg: 100.415 should be 100.42 not 100.41)

Avatar
Discard