Help

6

why we use 'from odoo.tools import float_is_zero' in odoo12?

Avatar
Syam G S

why we use 'from odoo.tools import float_is_zero' in odoo12?

please help

Thanks in advance

Avatar
Discard
1 Answer
6
Avatar
Abraham Qureshi
Best Answer

If you need to check if a float value is equal to zero it is recommended to use the method float_is_zero. This method accepts float value as required argument and two additional arguments: “precision_digits” and “precision_rounding”. Important thing is that precision must be given by “precision_digits” or “precision_rounding“, not both. It returns True if the given value is 0 at the given precision.

Avatar
Discard