function GetPercent(num, total) {
num = parseFloat(num);
total = parseFloat(total);
if (isNaN(num) || isNaN(total)) {
return "-";
}
return total <= 0 ? "0%" : (Math.round(num / total * 100) / 100.00);
}
原文地址:https://www.cnblogs.com/chenlove/p/8822682.html
时间: 2024-11-01 01:08:26