Using if x = < y display a, if x = > y display b
I have a calculator which at the moment displays results for any number entered into a text field. I want it so that if the value entered into the text field is equal to or less than a certain number (y), then a message (a) appears in my dynamic text field, if the value entered is more than (y) then the calculation (b) appears in the dynamic text field. Here is how my actionscript looks at the moment:
calc_btn.addEventListener(MouseEvent.CLICK, calcClick);
rvalue.border = false;
rvalue.restrict = "0-9";
var rateablevalue:String;
var calcRes:Number;
function calcClick(event:MouseEvent):void{
rateablevalue = rvalue.text;
if(cb1.selectedItem.label == "3 Months"){
calcRes = parseInt(rateablevalue) / 100 * 8.625;
calcRes.toString();
results_txt.text = String(calcRes);
} else if(cb1.selectedItem.label == "6 Months"){
calcRes = parseInt(rateablevalue) / 100 * 17.25;
calcRes.toString();
results_txt.text = String(calcRes);
}
}
I don't know what to add, or where! can anyone help?
thanks
Rick