hi guys im a newbie on html java script,,
im using switch statement but my final output always fall at my default statement
need help....
here's my code...
function finalgrade()
{
var texttgp, texttgm, texttgsf, texttgf, textfg;
texttgp = parseFloat(document.frmMacky.textTgp.value);
texttgm = parseFloat(document.frmMacky.textTgm.value);
texttgsf = parseFloat(document.frmMacky.textTgsf.value);
texttgf = parseFloat(document.frmMacky.textTgf.value);
textfg = (texttgp*.20)+(texttgm*.20)+(texttgsf*.20)+(texttgf*.40);
document.frmMacky.textFg.value = textfg.toFixed(2);
switch(textfg)
{
case(textfg >=95):
document.frmMacky.textEqvlnt.value="1.0";
break;
case(textfg ==94):
document.frmMacky.textEqvlnt.value="1.1";
break;
case(textfg ==93):
document.frmMacky.textEqvlnt.value="1.2";
break;
case(textfg ==92):
document.frmMacky.textEqvlnt.value="1.3";
break;
case(textfg ==91):
document.frmMacky.textEqvlnt.value="1.4";
break;
case(textfg ==90):
document.frmMacky.textEqvlnt.value="1.5";
break;
case(textfg ==89):
document.frmMacky.textEqvlnt.value="1.6";
break;
case(textfg ==87):
document.frmMacky.textEqvlnt.value="1.8";
break;
case(textfg ==86):
document.frmMacky.textEqvlnt.value="1.9";
break;
case(textfg ==85):
document.frmMacky.textEqvlnt.value="2.0";
break;
case(textfg >=82 && textfg <=84):
document.frmMacky.textEqvlnt.value="2.25";
break;
case(textfg >=81 && textfg <=82):
document.frmMacky.textEqvlnt.value="2.5";
break;
case(textfg >=76 && textfg <=79):
document.frmMacky.textEqvlnt.value="2.75";
break;
case(textfg ==75):
document.frmMacky.textEqvlnt.value= "3.0";
break;
default:
document.frmMacky.textEqvlnt.value= "Incomplete";
}