Skip to main content

Celsius and fahrenheit conversions in JavaScript.

function celsiusToFahrenheit(t) {
  return (212 - 32) / 100 * t + 32;
}

function fahrenheitToCelsius(t) {
  return 100 / (212 - 32) * (t - 32);
}