This question has been flagged
1 Reply
6606 Views

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

please help

Thanks in advance

Avatar
Discard
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