formatNum(num) {
let str = ""; //字符串累加
str = (Math.round(num * 100) / 100)
.toFixed(2)
.toString()
.replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
return $1 + ",";
});
return str; //字符串=>数组=>反转=>字符串
},
getRandomNumber(start, end) {
return Math.floor(Math.random() * (end - start) + start);
},