2021-11-11 数字转成千位符金额

export function toThousandFilter(num) {

  return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))

}

你可能感兴趣的:(2021-11-11 数字转成千位符金额)