UNPKG

tdesign-react

Version:
25 lines (20 loc) 657 B
/** * tdesign v1.16.2 * (c) 2025 tdesign * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var numberToPercent = function numberToPercent(number) { return "".concat(number * 100, "%"); }; function accAdd(num1, num2) { var precision1 = (num1.toString().split(".")[1] || "").length; var precision2 = (num2.toString().split(".")[1] || "").length; var scale = Math.pow(10, Math.max(precision1, precision2)); var sum = Math.round(num1 * scale) + Math.round(num2 * scale); return sum / scale; } exports.accAdd = accAdd; exports.numberToPercent = numberToPercent; //# sourceMappingURL=number.js.map