2023-06-19 16:36:59 -07:00
|
|
|
const round = function (number) {
|
|
|
|
return Math.round(number * 10) / 10
|
|
|
|
}
|
2017-08-25 08:27:07 -07:00
|
|
|
|
2023-06-19 16:36:59 -07:00
|
|
|
const convertToCelsius = function (F) {
|
|
|
|
return round((F - 32) * (5 / 9))
|
|
|
|
}
|
|
|
|
|
|
|
|
const convertToFahrenheit = function (C) {
|
|
|
|
return round((C * (9 / 5)) + 32)
|
|
|
|
}
|
2017-08-25 08:27:07 -07:00
|
|
|
|
2021-09-11 15:18:19 -07:00
|
|
|
// Do not edit below this line
|
2017-08-25 08:27:07 -07:00
|
|
|
module.exports = {
|
2022-11-12 11:49:28 -08:00
|
|
|
convertToCelsius,
|
2023-06-19 16:36:59 -07:00
|
|
|
convertToFahrenheit,
|
|
|
|
}
|