1
李凌
2025-09-20 6b754cd28c45741a24e7f7193b894e3e386e4af8
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, ',');
}