Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let formatter = MeasurementFormatter()
formatter.unitOptions = [.providedUnit]
formatter.locale = Locale(identifier: "en_US")
print(formatter.string(from: Measurement(value: 293, unit: UnitTemperature.kelvin)))
// 293 K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment