JavaScript小数四舍五入
//四舍五入number小数,fractionDigits小数保留位数 js数字计算有误差不推荐使用
function round(number,fractionDigits){
with(Math){
return round(number*pow(10,fractionDigits))/pow(10,fractionDigits);
}
}
//四舍五入number小数,fractionDigits小数保留位数 js数字计算有误差不推荐使用
function round(number,fractionDigits){
with(Math){
return round(number*pow(10,fractionDigits))/pow(10,fractionDigits);
}
}
暂无评论。
评论功能维护中,当前仅展示历史评论。