From 4057a78368f09b08e08034788dc38c54dd6d5778 Mon Sep 17 00:00:00 2001 From: ljx <15723110242@139.com> Date: Mon, 15 Sep 2025 18:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=B7=E6=A0=BC=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/utils/ruoyi.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index b8354ec..15482f5 100644 --- a/.env.development +++ b/.env.development @@ -7,7 +7,7 @@ VITE_APP_ENV = 'development' # 开发环境 # VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 李陈杰 209 -VITE_APP_BASE_API = 'http://192.168.110.180:8899' +# VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 李陈杰 209 # VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 曾涛 diff --git a/src/utils/ruoyi.ts b/src/utils/ruoyi.ts index c92994d..817fbad 100644 --- a/src/utils/ruoyi.ts +++ b/src/utils/ruoyi.ts @@ -74,6 +74,11 @@ export const formatPrice = (price, show = true) => { const fixedNum = num.toFixed(4); const [integer, decimal] = fixedNum.split('.'); + // 检查小数部分是否为0 + if (decimal === '0000') { + return `${integer}.00`; + } + // 千分位处理 const formattedInteger = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ',');