摄氏度华氏度相互转换

// 华氏度转摄氏度
const toCelsius = (fahrenheit) => {
    return (fahrenheit - 32) * 5 / 9;
}

// 摄氏度转华氏度
const toFahrenheit = (celsius) => {
    return (celsius * 9 / 5) + 32;
}

  

posted @ 2023-03-08 17:31  671_MrSix  阅读(198)  评论(0编辑  收藏  举报