summaryrefslogtreecommitdiff
path: root/odoo/tools
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-23 16:31:57 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-23 16:31:57 +0200
commit7f2bd086087f73878f62933ecd2e7c2bed32142e (patch)
tree9b3cfe4f04130d5a4dce08d73a94ff8fe548dad7 /odoo/tools
parent8361ec881920b6f26e86ced0483e5a0b81c60954 (diff)
[FIX] core: define float_utils.round also in python2
Diffstat (limited to 'odoo/tools')
-rw-r--r--odoo/tools/float_utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/odoo/tools/float_utils.py b/odoo/tools/float_utils.py
index 8f95a43ba6f..33ef00a43dd 100644
--- a/odoo/tools/float_utils.py
+++ b/odoo/tools/float_utils.py
@@ -23,6 +23,8 @@ if not pycompat.PY2:
return f + math.copysign(0.5, f)
# copysign ensures round(-0.) -> -0 *and* result is a float
return math.copysign(roundf, f)
+else:
+ round = round
def _float_check_precision(precision_digits=None, precision_rounding=None):
assert (precision_digits is not None or precision_rounding is not None) and \