一个小的js函数,利用此函数可以实现数字的四舍五入,其中number是值,fractionDigits是保留的位数。
function round2(number,fractionDigits){
with(Math){
return round(number*pow(10,fractionDigits))/pow(10,fractionDigits);
}
}
一个小的js函数,利用此函数可以实现数字的四舍五入,其中number是值,fractionDigits是保留的位数。
function round2(number,fractionDigits){
with(Math){
return round(number*pow(10,fractionDigits))/pow(10,fractionDigits);
}
}