这是假设将转换后的数字作为整数返回。这部分工作,但它并没有转向正确的转换。为什么不能正确转换?
var input = prompt('Please enter your temp in fahrenheit');
function converter(){
var x = Math.round(input - 32 * 5/9);
console.log(x);
return x;
}
alert('The temp in celsius is: ' + converter());
记住BODMAS,BEDMAS还是PEDMAS? – evolutionxbox