CN-1219: 实体搜索页下方统计原型优化
This commit is contained in:
@@ -1360,10 +1360,10 @@ export function toUpperCaseByString (str) {
|
||||
* @returns {string}
|
||||
*/
|
||||
export function numberWithCommas (num) {
|
||||
if (typeof num === 'number') {
|
||||
if (num) {
|
||||
return num.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ',')
|
||||
} else {
|
||||
return num
|
||||
return '-'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user