2024-01-05 21:03:43 +00:00
|
|
|
|
const convertToCelsius = function(deg) {
|
2024-01-05 21:06:28 +00:00
|
|
|
|
return Math.round((deg - 32) * (5/9) * 10) / 10;
|
2024-01-05 19:11:55 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-01-05 21:08:37 +00:00
|
|
|
|
const convertToFahrenheit = function(deg) {
|
|
|
|
|
return Math.round((deg * (9/5) + 32) * 10) / 10;
|
2024-01-05 21:03:43 +00:00
|
|
|
|
// x °C ≘ (x ×9/5+ 32) °F
|
2024-01-05 19:11:55 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Do not edit below this line
|
|
|
|
|
module.exports = {
|
|
|
|
|
convertToCelsius,
|
|
|
|
|
convertToFahrenheit
|
|
|
|
|
};
|