# Temperature Snippets

0

0

Arcktosh

temperature

The following code defines several functions to convert between different temperature units.

Library: `react`

``````const CelciusToFahrenheit = (celcius: number) => {
return (celcius * 9) / 5 + 32
}
const CelciusToKelvin = (celcius: number) => {
return celcius + 273.15
}
const CelciusToRankine = (celcius: number) => {
return (celcius * 9) / 5 + 491.67
}
const FahrenheitToCelcius = (fahrenheit: number) => {
return ((fahrenheit - 32) * 5) / 9
}
const FahrenheitToKelvin = (fahrenheit: number) => {
return ((fahrenheit + 459.67) * 5) / 9
}
const FahrenheitToRankine = (fahrenheit: number) => {
return fahrenheit + 459.67
}
const KelvinToCelcius = (kelvin: number) => {
return kelvin - 273.15
}
const KelvinToFahrenheit = (kelvin: number) => {
return ((kelvin - 273.15) * 9) / 5 + 32
}
const KelvinToRankine = (kelvin: number) => {
return (kelvin * 9) / 5
}
const RankineToCelcius = (rankine: number) => {
return ((rankine - 491.67) * 5) / 9
}
const RankineToFahrenheit = (rankine: number) => {
return rankine - 459.67
}
const RankineToKelvin = (rankine: number) => {
return (rankine * 5) / 9
}
``````
• Rulesets
• Playground
• Snippets
• Cookbooks
• Security