summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core/utils.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2018-06-22 10:14:05 +0200
committerAdrien Dieudonne <adr@odoo.com>2018-07-06 14:09:09 +0200
commitdcc4d716234349c71f51edbd621963b5210c65de (patch)
treec0d5881134f0de9f163226f0702c09d810af6053 /addons/web/static/src/js/core/utils.js
parent64f3580af7c93abe3402493b2ab24d99d00fa584 (diff)
[REF] web: move some code from pyeval to lib py_extras
Some functions that were in web.pyeval were actually "odoo independant". To make them easier to manage/understand, this commit move them in the library py.js, as an extra file.
Diffstat (limited to 'addons/web/static/src/js/core/utils.js')
-rw-r--r--addons/web/static/src/js/core/utils.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js
index ffeb4a1de87..3068a6528c9 100644
--- a/addons/web/static/src/js/core/utils.js
+++ b/addons/web/static/src/js/core/utils.js
@@ -52,20 +52,6 @@ var utils = {
return Math.max(min, Math.min(max, val));
},
/**
- * computes (Math.floor(a/b), a%b and passes that to the callback.
- *
- * returns the callback's result
- */
- divmod: function (a, b, fn) {
- var mod = a%b;
- // in python, sign(a % b) === sign(b). Not in JS. If wrong side, add a
- // round of b
- if (mod > 0 && b < 0 || mod < 0 && b > 0) {
- mod += b;
- }
- return fn(Math.floor(a/b), mod);
- },
- /**
* @param {number} value
* @param {integer} decimals
* @returns {boolean}
@@ -290,17 +276,6 @@ var utils = {
return new Array(size - str.length + 1).join('0') + str;
},
/**
- * Passes the fractional and integer parts of x to the callback, returns
- * the callback's result
- */
- modf: function (x, fn) {
- var mod = x%1;
- if (mod < 0) {
- mod += 1;
- }
- return fn(mod, Math.floor(x));
- },
- /**
* performs a half up rounding with a fixed amount of decimals, correcting for float loss of precision
* See the corresponding float_round() in server/tools/float_utils.py for more info
* @param {Number} value the value to be rounded