mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 19:09:20 +08:00
fix(workbench): 修复税率输入7%时显示7.000000000000001的浮点精度问题
This commit is contained in:
@@ -131,7 +131,7 @@ const formatTaxRate = (value: null | number | string | undefined) => {
|
|||||||
const parseTaxRate = (value: string | undefined) => {
|
const parseTaxRate = (value: string | undefined) => {
|
||||||
if (!value) return 0;
|
if (!value) return 0;
|
||||||
const num = Number(value.replace('%', '').trim());
|
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[]>([]);
|
const platforms = ref<PlatformVO.Info[]>([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user