Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created January 17, 2021 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/504802b2f5cd3743847443eb0abb1a55 to your computer and use it in GitHub Desktop.
Save laevandus/504802b2f5cd3743847443eb0abb1a55 to your computer and use it in GitHub Desktop.
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