mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
13 lines
288 B
JavaScript
13 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,
|
|
};
|