Temperature Converter
Last updated
Last updated
Question
Build a simple temperature converter widget that contains two text inputs temperatures in Celsius and Fahrenheit respectively, allowing for conversion between the temperature scales.
Initially, both fields are empty. When a number value is entered into a text input, the other input will be calculated and reflected.
Round to 4 decimal places where necessary.
If a non-numerical string is entered into one input, the other input will be blank.
The last two requirements might not be given to you during interviews, you're expected to clarify.
P.S. To convert temperatures in degrees Celsius to Fahrenheit, multiply by 1.8 (or 9/5) and add 32.
Here's an example of Google's temperature converter (ignore the bottom row showing the formula):
Answer
Doubt
https://www.loom.com/share/481676f467ba455995f583bf3bbdc2b2?sid=787e6732-437f-4618-befb-495198bc395b