convert_temperature()
Learn how to use the convert_temperature() function to convert a temperature input value from one unit to another.
Convert a temperature value from one unit to another.
Syntax
convert_temperature(value,from,to)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| value | real | ✔️ | The value to be converted. |
| from | string | ✔️ | The unit to convert from. For possible values, see Conversion units. |
| to | string | ✔️ | The unit to convert to. For possible values, see Conversion units. |
Conversion units
- DegreeCelsius
- DegreeDelisle
- DegreeFahrenheit
- DegreeNewton
- DegreeRankine
- DegreeReaumur
- DegreeRoemer
- Kelvin
- MillidegreeCelsius
- SolarTemperature
Returns
Returns the input value converted from one temperature unit to another. Invalid units return null.
Example
print result = convert_temperature(1.2, 'Kelvin', 'DegreeCelsius')
Output
| result |
|---|
| -271.95 |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.