在获得一致的结果时遇到问题,希望一些指针尝试解决这个问题我自己碰壁了
Excel公式:
=IF(C15=""," ",IF(D15="O"(((ROUNDUP(((C15+0.625)/(6.25-0.5)),0)*6.25))+4.125+0.5),IF(D15="t",C15,"ERROR")))
C15= 100.00
逻辑测试..
D15="O"
第二个逻辑测试,验证 100.00 可以扩展到该数字的预定结果......
if D15="t"
因为被困它停留在100.00
......我可以稍后用“if else”替换逻辑测试,仍在学习
<html>
<head>
<title>Excel Formula to JavaScript</title>
</head>
<body>
<script type="text/javascript">
var num1 = 170.00;
var acc1 = (num1 + 0.625)/(6.25-0.50);
var acc2 = Math.round((acc1 * 10) / 10) * 6.25 + (4.125 + 0.50);
document.write(acc2).toFixed(3);
</script>
<div>
<br>
num1= 30.00 result should be 42.125".... incorrect result!
<br>
<br>
num1= 40.00 result should be 54.625".... incorrect result!
<br>
<br>
num1= 57.00 result should be 73.365".... incorrect result!
<br>
<br>
num1= 85.00 result should be 98.375"... result correct
<br>
<br>
when num1= 100.00 result should be 117.125"... result correct
<br>
<br>
seems any input under 77 result will be incorrect
</div>
</body>
</html>