张诺
19 小时以前 e705ef7b15c04307d6f37b388564dedfaeef4a55
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 {