我已经搜索了几天,试图找到解决方案。我查看了 php.net 信息,但它似乎与我下面的代码格式不同。请有人能告诉我如何四舍五入这种计算。谢谢
function startCalc(){
interval = setInterval("calc()",1);
}
function calc(){
one = document.autoSumForm.firstBox.value;
two = document.autoSumForm.secondBox.value = ((one*20) + (110*20))/17;
three = document.autoSumForm.thirdBox.value;
four = document.autoSumForm.fourthBox.value = ((three*20) + (150*20))/17;
five = document.autoSumForm.fifthBox.value;
six = document.autoSumForm.sixthBox.value = ((five*20) + (250*20))/17;
seven = document.autoSumForm.seventhBox.value = (four*1) - (two*1);
eight = document.autoSumForm.eigthBox.value = (six*1) - (two*1);
}
function stopCalc(){
clearInterval(interval);
}