/**
* @description 计算小数点后面几位的四舍五入处理
* @param {*} num
* @param {*} digit
* @returns
*/
export const mathRound = (num, digit = 2) => {
if (/^[0-9]+.?[0-9]*/.test(num)) {
return Math.round(((num * 1 || 0) + Number.EPSILON) * Math.pow(10, digit)) / Math.pow(10, digit)
} else {
return ''
}
}
08-28
2940
06-02
1482
06-25
242
10-09
162