Temperature Converter

Published by Matt in

Create a function that converts Celsius to Fahrenheit and vice versa.

Examples

convert("35°C") ➞ "95°F"

convert("19°F") ➞ "-7°C"

convert("33") ➞ "Error"

Notes

  • Round to the nearest integer.
  • If the input is incorrect, return "Error".
  • For the formulae to convert back and forth, check the Resources tab.
Watch a quick demo on how Edabit works.