Published
- 1 min read
Convert temperature units: Celsius, Fahrenheit and Kelvin Swift
The solution for this is noted below
Convert temperature units: Celsius, Fahrenheit and Kelvin Swift
Solution
let t = Measurement(value: 10.0, unit: UnitTemperature.celsius)
print(t.converted(to: .fahrenheit).value) // 49.99999999999585
print(t.converted(to: .kelvin).value) // 283.15
Try other methods by searching on the site. That is if this doesn’t work