fix(workbench): 修复税率输入7%时显示7.000000000000001的浮点精度问题

This commit is contained in:
小蟑螂
2026-05-16 23:34:36 +08:00
parent 94197c487f
commit 621a2e5785
@@ -131,7 +131,7 @@ const formatTaxRate = (value: null | number | string | undefined) => {
const parseTaxRate = (value: string | undefined) => {
if (!value) return 0;
const num = Number(value.replace('%', '').trim());
return Number.isFinite(num) ? num / 100 : 0;
return Number.isFinite(num) ? Math.round((num / 100) * 1e12) / 1e12 : 0;
};
const platforms = ref<PlatformVO.Info[]>([]);