From 349c48e168b9f2580334422228acde7d1b21bede Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 05 Jun 2026 11:19:15 +0800
Subject: [PATCH] 1

---
 src/utils/index.js |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/utils/index.js b/src/utils/index.js
index 214438f..ce89959 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -78,7 +78,6 @@
   }
 }
 
-
 // 小数展示,保留五位小数
 export const formatNumber = (num) => {
   if (typeof (num) !== 'number') {
@@ -99,7 +98,6 @@
   }
 
 }
-
 
 // 保留五位小数
 export const formatNumberToFixedFive = (num) => {
@@ -137,7 +135,6 @@
   }
 }
 
-
 export const formatMoney = (val) => {
   if(val === 0){
     return 0
@@ -161,10 +158,19 @@
   return (val / Math.pow(num, 4)).toFixed(2) + "T"; //T  
 }
 
-
 export  const formatNews = (str) => {
   if(!str) {
     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, ',');
+}
+
+/** 体验矿机 test=Y,普通矿机 cycle 为可解锁分钟数 */
+export function isMinerTest(test) {
+  return test === 'Y' || test === true
 }
\ No newline at end of file

--
Gitblit v1.9.3