odin-default-js-exercises/07_tempConversion/tempConversion.js

16 lines
295 B
JavaScript
Raw Normal View History

2022-09-06 12:18:39 +00:00
const ftoc = function (temp) {
let celcius = ((temp - 32) * 5) / 9;
return Number(celcius.toFixed(1));
};
2017-08-25 15:27:07 +00:00
2022-09-06 12:18:39 +00:00
const ctof = function (temp) {
let fahrenheit = (temp * 9) / 5 + 32;
return Number(fahrenheit.toFixed(1));
};
2017-08-25 15:27:07 +00:00
// Do not edit below this line
2017-08-25 15:27:07 +00:00
module.exports = {
ftoc,
2022-09-06 12:18:39 +00:00
ctof,
};