odin-javascript-exercises/07_tempConversion/solution/tempConversion-solution.js
2023-01-21 12:53:41 -05:00

12 lines
288 B
JavaScript

const convertToCelsius = function (fahrenheit) {
return Math.round((fahrenheit - 32) * (5 / 9) * 10) / 10;
};
const convertToFahrenheit = function (celsius) {
return Math.round(((celsius * 9) / 5 + 32) * 10) / 10;
};
module.exports = {
convertToCelsius,
convertToFahrenheit,
};