How can I round off numbers, like for the example below;
<title>JavaScript Calculation</title>
</head>
<body>
<script Language = "JavaScript">
var farentemp
farentemp=prompt("Please enter a temperature in Fahrenheit.",""
var celtemp
celtemp=(5/9)*(farentemp-32)
document.write("In Celsius, the temperature is "
document.write(celtemp);
document.write(" degrees!"
</script>
if I put in a temparature of 24 degrees Farenheit, it gives me something like -4.444444444444445. I am trying to figure out how to round it off to 2 decimals.
thanks
<title>JavaScript Calculation</title>
</head>
<body>
<script Language = "JavaScript">
var farentemp
farentemp=prompt("Please enter a temperature in Fahrenheit.",""
var celtemp
celtemp=(5/9)*(farentemp-32)
document.write("In Celsius, the temperature is "
document.write(celtemp);
document.write(" degrees!"
</script>
if I put in a temparature of 24 degrees Farenheit, it gives me something like -4.444444444444445. I am trying to figure out how to round it off to 2 decimals.
thanks