UNPKG

dareway-rui

Version:

29 lines (23 loc) 630 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.default = void 0; function round(value, how) { var num = Number(value); num = Number(num.toFixed(10)); var tempNum = null, result = null; if (num < 0) { tempNum = -num; result = Math.round((tempNum * Math.pow(10, how)).toFixed(10)) / Math.pow(10, how); result = -result; return result; } return Math.round((num * Math.pow(10, how)).toFixed(10)) / Math.pow(10, how); } var _default = { round: round }; exports.default = _default; //@ sourceMappingURL=NumberUtil.js.map