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, ',');