lambda c: c * 1.8 + 32.0,
"°F",
),
- "Celsius": Converter(
- "Celsius", "temperature", lambda c: c, lambda c: c, "°C"
- ),
+ "Celsius": Converter("Celsius", "temperature", lambda c: c, lambda c: c, "°C"),
"Kelvin": Converter(
"Kelvin",
"temperature",
return _convert(magnitude, src, dst)
-def _convert(
- magnitude: Number, from_unit: Converter, to_unit: Converter
-) -> float:
+def _convert(magnitude: Number, from_unit: Converter, to_unit: Converter) -> float:
canonical = from_unit.to_canonical(magnitude)
converted = to_unit.from_canonical(canonical)
return float(converted)