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