Need help with calculation

QWERTYMD

Newbie
Joined
Jun 14, 2011
Messages
3
Reaction score
0
Hello,
I've created online calculator, but for some reasons calculations are all of. Maybe someone knows what is wrong with it?

Code:
 if (document.getElementById("RadioGroup1_0").checked == true) {
if (document.getElementById("RadioGroup2_1").checked == true) {if (document.getElementById("RadioGroup3_0").checked == true) {document.getElementById("output").innerText=Math.round(x*37*0.85);}{document.getElementById("c").innerText=Math.round((((x*37*0.85)-(x*10.2+x*7.65))*0.25));}{document.getElementById("o").innerText=Math.round(x*3*0.85);}{document.getElementById("a").innerText=Math.round(x*1*0.85);}}
        

if (document.getElementById("RadioGroup2_2").checked == true) {if (document.getElementById("RadioGroup3_0").checked == true) {document.getElementById("output").innerText=Math.round(x*40*0.85);}{document.getElementById("c").innerText=Math.round((((x*40*0.85)-(x*10.2+x*7.65))*0.25));}{document.getElementById("o").innerText=Math.round(x*3*0.85);}{document.getElementById("a").innerText=Math.round(x*1*0.85);}}
        }
 
It would be helpful to see the html that goes along with the javascript you've posted. I would recommend either posting a URL to the live calculator or post it on CodePen(hxxp://codepen.io/).
 
Back
Top