odin-default-js-exercises/tempConversion
Tatiana b2f2211321 Revert "Resolve merge conflicts"
This reverts commit 61338e0ca0, reversing
changes made to b9983073cc.
2021-05-08 11:27:13 -07:00
..
README.md Capitalize 'Hint'-subtitles 2018-08-07 11:25:16 +01:00
tempConversion.js Revert "update cloning link" 2021-05-08 11:25:04 -07:00
tempConversion.spec.js Revert "Resolve merge conflicts" 2021-05-08 11:27:13 -07:00

README.md

Exercise 06 - tempConversion

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

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

ctof(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., ftoc(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.