odin-default-js-exercises/07_tempConversion
Abhi Joshi ceee6258a2 The issue lies in the inability to run npm test for problems 2, 3, 4, 5, and 7. To resolve this, rename the test files by adding an 'a' in front of them (e.g., from removeFromArray.spec.js to aRemoveFromArray.spec.js). This error doesn't occur when the test file name is alphabetically before readme.md. 2023-12-28 11:46:23 +05:30
..
solution Remove test skips for solutions 2023-02-01 18:58:58 -05:00
README.md Missed README.md 2022-11-12 20:59:52 +01:00
aTempConversion.spec.js The issue lies in the inability to run npm test for problems 2, 3, 4, 5, and 7. To resolve this, rename the test files by adding an 'a' in front of them (e.g., from removeFromArray.spec.js to aRemoveFromArray.spec.js). This error doesn't occur when the test file name is alphabetically before readme.md. 2023-12-28 11:46:23 +05:30
tempConversion.js Update tempConversion function's naming 2022-11-12 20:49:28 +01:00

README.md

Exercise 07 - tempConversion

Write two functions that convert temperatures from Fahrenheit to Celsius, and vice versa:

convertToCelsius(32) // fahrenheit to celsius, should return 0

convertToFahrenheit(0) // celsius to fahrenheit, should return 32

Because we are human, we want the result temperature to be rounded to one decimal place: i.e., convertToCelsius(100) should return 37.8 and not 37.77777777777778.

This exercise asks you to create more than one function so the module.exports section of the spec file looks a little different this time. Nothing to worry about, we're just packaging both functions into a single object to be exported.

Hints

  • You can find the relevant formulae on Wikipedia.

  • Try to find by yourself on the Internet how to round a number to 1 decimal place in JavaScript. If you struggle, have a look here.