mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 23:49:19 +08:00
fix(workbench): 移除精度配置并优化formatter消除浮点显示问题
This commit is contained in:
@@ -125,7 +125,7 @@ const formatTaxRate = (value: null | number | string | undefined) => {
|
|||||||
if (value === null || value === undefined || value === '') return '';
|
if (value === null || value === undefined || value === '') return '';
|
||||||
const num = Number(value);
|
const num = Number(value);
|
||||||
if (!Number.isFinite(num)) return '';
|
if (!Number.isFinite(num)) return '';
|
||||||
return `${num * 100}%`;
|
return `${Math.round(num * 100 * 1e10) / 1e10}%`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const parseTaxRate = (value: string | undefined) => {
|
const parseTaxRate = (value: string | undefined) => {
|
||||||
@@ -362,7 +362,6 @@ onUnmounted(() => {
|
|||||||
:min="0"
|
:min="0"
|
||||||
:max="1"
|
:max="1"
|
||||||
:step="0.01"
|
:step="0.01"
|
||||||
:precision="2"
|
|
||||||
size="small"
|
size="small"
|
||||||
class="tax-rate-input !h-8 !w-20 !rounded-lg !border-none !bg-white/30 !text-center !text-sm !font-bold dark:!bg-[hsl(240deg_3.7%_22%/30%)]"
|
class="tax-rate-input !h-8 !w-20 !rounded-lg !border-none !bg-white/30 !text-center !text-sm !font-bold dark:!bg-[hsl(240deg_3.7%_22%/30%)]"
|
||||||
:formatter="formatTaxRate"
|
:formatter="formatTaxRate"
|
||||||
|
|||||||
Reference in New Issue
Block a user