张诺
21 小时以前 7e1c5eb99eda42ff9d54b7ecf1bbab9920dc17e6
src/utils/summarizeTable.js
@@ -41,13 +41,13 @@
  return sums;
};
// 不含税总价计算
const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate, precision = 2) => {
  const taxRateDecimal = taxRate / 100;
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(precision);
};
// 含税总价计算
const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
  return (taxInclusiveUnitPrice * quantity).toFixed(2);
const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity, precision = 2) => {
  return (taxInclusiveUnitPrice * quantity).toFixed(precision);
};
// 导出函数供其他文件使用
export {