lyb-js 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,7 +99,7 @@ export const libJsCalculateExpression = (expression, point = 2) => {
99
99
  try {
100
100
  //调用计算器并返回结果
101
101
  const result = evaluate(expression);
102
- return Number(result.toFixed(point)); //保留指定的小数位数
102
+ return Number(result.toFixed(point, Decimal.ROUND_DOWN)); //保留指定的小数位数
103
103
  }
104
104
  catch (error) {
105
105
  throw new Error("表达式计算失败:" + error.message);
@@ -18,5 +18,5 @@ export const libJsDecimal = (num1, num2, operator, point = 2) => {
18
18
  },
19
19
  };
20
20
  const result = calc[operator](new Decimal(num1), new Decimal(num2));
21
- return Number(result.toFixed(point));
21
+ return Number(result.toFixed(point, Decimal.ROUND_DOWN));
22
22
  };