Created
September 11, 2021 00:39
-
-
Save ali-master/c40222a4cb96914073a1ef43356d1783 to your computer and use it in GitHub Desktop.
Two functions to convert from Celsius to Fahrenheit and back in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toCelsius(fahrenheit) { | |
return (fahrenheit - 32) * 5 / 9; | |
} | |
function toFahrenheit(celsius) { | |
return (celsius * 9 / 5) + 32; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment