I'm making a javascript/html calculator for school. Everything is working fine except for the division. Here is the code:
if(x==="/"){
memory1 = parseFloat(memory1);
memory2 = parseFloat(memory2);
result = parseFloat(result);
if(result > 0){
result = result / memory1;
document.TextBox.Answer.value = result;
memory1 = "";
last = "/";
}
The result text box shows 'NaN' even though I'm converting to a Float. We're using Chrome for Mac & Windows.