1
李凌
2025-09-19 e1e51991ad91c14fa00c5cf46f95e514f676ac4d
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, ',');
}