From dadebef19c596774dc84038ee8a2c2a13c4ffe39 Mon Sep 17 00:00:00 2001 From: xxssyyyyssxx Date: Mon, 27 Dec 2021 10:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E5=AD=97=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=88=86=E9=9A=94=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/static/assets/js/project_common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/assets/js/project_common.js b/src/main/resources/static/assets/js/project_common.js index 1b61ae2..4bdb5f3 100644 --- a/src/main/resources/static/assets/js/project_common.js +++ b/src/main/resources/static/assets/js/project_common.js @@ -33,7 +33,10 @@ function f2(x) { * @returns {string} */ function f2Fixed(f) { - return Number(f).toFixed(2); + //return Number(f).toFixed(2); + + //格式化413,423,423.24 + return f.toLocaleString('zh',{minimumFractionDigits: 2, maximumFractionDigits: 2, useGrouping: true}); }