Convert a given value from Rankine to Fahrenheit and round it to 2 decimal places. Wikipedia reference: https://en.wikipedia.org/wiki/Rankine_scale Wikipedia reference: https://en.wikipedia.org/wiki/Fahrenheit >>> rankine_to_fahrenheit(273.15) -186.52 >>> rankine_to_fahrenh
(rankine: float, ndigits: int = 2)
| 264 | |
| 265 | |
| 266 | def rankine_to_fahrenheit(rankine: float, ndigits: int = 2) -> float: |
| 267 | """ |
| 268 | Convert a given value from Rankine to Fahrenheit and round it to 2 decimal places. |
| 269 | Wikipedia reference: https://en.wikipedia.org/wiki/Rankine_scale |
| 270 | Wikipedia reference: https://en.wikipedia.org/wiki/Fahrenheit |
| 271 | |
| 272 | >>> rankine_to_fahrenheit(273.15) |
| 273 | -186.52 |
| 274 | >>> rankine_to_fahrenheit(300) |
| 275 | -159.67 |
| 276 | >>> rankine_to_fahrenheit("315.5") |
| 277 | -144.17 |
| 278 | >>> rankine_to_fahrenheit("rankine") |
| 279 | Traceback (most recent call last): |
| 280 | ... |
| 281 | ValueError: could not convert string to float: 'rankine' |
| 282 | """ |
| 283 | return round(float(rankine) - 459.67, ndigits) |
| 284 | |
| 285 | |
| 286 | def rankine_to_kelvin(rankine: float, ndigits: int = 2) -> float: |
nothing calls this directly
no outgoing calls
no test coverage detected