Convert a given value from Rankine to Kelvin and round it to 2 decimal places. Wikipedia reference: https://en.wikipedia.org/wiki/Rankine_scale Wikipedia reference: https://en.wikipedia.org/wiki/Kelvin >>> rankine_to_kelvin(0) 0.0 >>> rankine_to_kelvin(20.0) 11.11 >
(rankine: float, ndigits: int = 2)
| 284 | |
| 285 | |
| 286 | def rankine_to_kelvin(rankine: float, ndigits: int = 2) -> float: |
| 287 | """ |
| 288 | Convert a given value from Rankine to Kelvin and round it to 2 decimal places. |
| 289 | Wikipedia reference: https://en.wikipedia.org/wiki/Rankine_scale |
| 290 | Wikipedia reference: https://en.wikipedia.org/wiki/Kelvin |
| 291 | |
| 292 | >>> rankine_to_kelvin(0) |
| 293 | 0.0 |
| 294 | >>> rankine_to_kelvin(20.0) |
| 295 | 11.11 |
| 296 | >>> rankine_to_kelvin("40") |
| 297 | 22.22 |
| 298 | >>> rankine_to_kelvin("rankine") |
| 299 | Traceback (most recent call last): |
| 300 | ... |
| 301 | ValueError: could not convert string to float: 'rankine' |
| 302 | """ |
| 303 | return round((float(rankine) * 5 / 9), ndigits) |
| 304 | |
| 305 | |
| 306 | def reaumur_to_kelvin(reaumur: float, ndigits: int = 2) -> float: |
nothing calls this directly
no outgoing calls
no test coverage detected