feat: 千位制处理时,去除逗号后的空格

This commit is contained in:
刘洪洪
2023-06-25 11:18:37 +08:00
parent fcca6142df
commit 22fa0856fd

View File

@@ -1291,7 +1291,7 @@ export function toUpperCaseByString (str) {
*/ */
export function numberWithCommas (num) { export function numberWithCommas (num) {
if (typeof num === 'number') { if (typeof num === 'number') {
return num.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ', ') return num.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ',')
} else { } else {
return num return num
} }