【issues/7830】合计小数计算精度 ---

pull/7570/merge
JEECG 2025-02-24 22:48:45 +08:00
parent 45f905ddac
commit 56661815ec
1 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { reactive } from "vue";
import { getTenantId, getToken } from "/@/utils/auth";
import { useUserStoreWithOut } from "/@/store/modules/user";
import dayjs from 'dayjs';
import Big from 'big.js';
import { Modal } from "ant-design-vue";
import { defHttp } from "@/utils/http/axios";
@ -148,11 +149,16 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[
// update-begin--author:liaozhiyang---date:20240118---forQQYUN-7891PR Nuber
const value = Number(next[key]);
if (!Number.isNaN(value)) {
prev += value;
// update-begin--author:liaozhiyang---date:20250224---forissues/7830
prev = Big(prev).plus(value).toString();
// update-end--author:liaozhiyang---date:20250224---forissues/7830
}
// update-end--author:liaozhiyang---date:20240118---forQQYUN-7891PR Nuber
// update-end--author:liaozhiyang---date:20240118---forissues/7830PR Nuber
return prev;
}, 0);
// update-begin--author:liaozhiyang---date:20250224---forissues/7830
totals[key] = +totals[key];
// update-end--author:liaozhiyang---date:20250224---forissues/7830
});
return totals;
}