From 7a4e91cad492b5f2411ae3ec074dae533d0ec335 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Thu, 18 Sep 2025 09:57:07 +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