From ad2c6626fc2d85053a1b80766fb18263ecfc3d97 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 19 Sep 2025 19:20:08 +0800
Subject: [PATCH] 1

---
 src/utils/index.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/utils/index.js b/src/utils/index.js
index 214438f..49b2e1a 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -167,4 +167,9 @@
     return ''
   }
   return str.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, '').replace(/&nbsp;/ig, '')
+}
+
+export const formatWithCommas = (num) => {
+  if (num === null || num === undefined || isNaN(num)) return '--';
+  return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
 }
\ No newline at end of file

--
Gitblit v1.9.3