From c17c207d0eb41ef6a3f49ec554be5a9a02ecd167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Boisseau-Sierra?= Date: Fri, 8 Jun 2018 23:14:20 -0400 Subject: [PATCH] Rephrase tempConversion instructions - keep only main instructions above code sample (and move explanation about `module.exports` after the example) - clarify that results should be rounded to one decimal place (as assume by tests) --- tempConversion/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tempConversion/README.md b/tempConversion/README.md index 959d029..0f34a07 100644 --- a/tempConversion/README.md +++ b/tempConversion/README.md @@ -1,14 +1,17 @@ # Exercise 06 - tempConversion -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 the functions into an object to be exported. - -Write two functions that convert temperatures from Fahrenheit to Celsius (and the other way around): +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 -The math here is fairly straightforward.. just google the formula and implement it in the code +- You can find the relevant formulae on [Wikipedia](https://en.wikipedia.org/wiki/Conversion_of_units_of_temperature). + +- 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](https://stackoverflow.com/q/7342957/5433628).