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