From 829bea3861e92886faf43a5452fad93546f8ee12 Mon Sep 17 00:00:00 2001 From: DH Date: Mon, 29 Jan 2024 01:24:27 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E9=94=80=E9=87=8F=E5=8F=AF=E8=83=BD=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=BD=99=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DH --- sheep/hooks/useGoods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sheep/hooks/useGoods.js b/sheep/hooks/useGoods.js index 2d290aff..73893bf5 100644 --- a/sheep/hooks/useGoods.js +++ b/sheep/hooks/useGoods.js @@ -56,7 +56,7 @@ export function formatNum(prefix, type, num) { // 例如:100 - 199 显示为 100+ // 9000 - 9999 显示为 9000+ let pow = Math.pow(10, `${num}`.length - 1); - return `${prefix}${(num / pow) * pow}+`; + return `${prefix}${Math.round((num / pow) * pow)}+`; } // 格式化价格