张诺
6 小时以前 b14930d7ac2ce362403ea28d0bae724161bc1f3c
src/utils/summarizeTable.js
@@ -26,9 +26,9 @@
          // 如果指定了不需要保留小数,则直接转换为整数
          sums[index] = Math.round(sum).toString();
        } else {
          // 默认保留两位小数
          // 默认保留三位小数
          sums[index] = parseFloat(sum).toFixed(
            specialFormat[prop]?.decimalPlaces ?? 2
            specialFormat[prop]?.decimalPlaces ?? 3
          );
        }
      } else {
@@ -43,11 +43,11 @@
// 不含税总价计算
const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
  const taxRateDecimal = taxRate / 100;
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(3);
};
// 含税总价计算
const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
  return (taxInclusiveUnitPrice * quantity).toFixed(2);
  return (taxInclusiveUnitPrice * quantity).toFixed(3);
};
// 导出函数供其他文件使用
export {