2023-11-04 11:05:11 +00:00
|
|
|
const convertToCelsius = function(temp) {
|
|
|
|
let Ftemp = temp;
|
|
|
|
let intoCelsius = (Ftemp - 32)* 5/9
|
|
|
|
return Math.round(intoCelsius*10)/10;
|
2021-03-03 02:13:24 +00:00
|
|
|
};
|
2017-08-25 15:27:07 +00:00
|
|
|
|
2023-11-04 11:05:11 +00:00
|
|
|
const convertToFahrenheit = function(temp) {
|
|
|
|
let cTemp = temp;
|
|
|
|
let intoFahrenheit = (cTemp * 9/5 + 32)
|
|
|
|
return Math.round(intoFahrenheit* 10) / 10;
|
2021-03-03 02:13:24 +00:00
|
|
|
};
|
2017-08-25 15:27:07 +00:00
|
|
|
|
2023-11-04 11:05:11 +00:00
|
|
|
convertToCelsius(32)
|
|
|
|
convertToFahrenheit(0)
|
|
|
|
|
|
|
|
|
2017-08-25 15:27:07 +00:00
|
|
|
module.exports = {
|
2022-11-12 19:49:28 +00:00
|
|
|
convertToCelsius,
|
|
|
|
convertToFahrenheit
|
2021-03-03 02:13:24 +00:00
|
|
|
};
|