// 计算百分比
const GetPercent=(num, total) =>{
num = parseFloat(num);
total = parseFloat(total);
if (isNaN(num) || isNaN(total)) {
return "-";
}
return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00 + "%");
}
posted on 2019-07-15 16:53  假装新手  阅读(458)  评论(0编辑  收藏  举报