js保留两位小数的数字格式化方法 // 格式化数字(保留两位小数) numberFormat (num) { let percent = Number(num.toString().match(/^d+(?:.d{0,2})?/)) return percent + '%' }