张诺
2 天以前 195770f92f7d739ffba6447fdbf3a3d5b9e009fa
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 {