<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Measurement/FormatStyle/usage",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11MeasurementVAASo11NSDimensionCRbzrlE11FormatStyleV5usageAA0bD9UnitUsageVyxGSgvp"
  },
  "title" : "usage"
}
-->

# usage

The intended purpose of the formatted measurement.

```
var usage: MeasurementFormatUnitUsage<UnitType>?
```

## Discussion

You can use the `usage` property to specify the intended purpose of the formatted measurement. The default option, `general`, formats the measurement with the default unit for the current locale. The `asProvided` option formats the measurement using the specified unit, ignoring the unit that the locale uses.

The following example shows a formatted temperature using the default unit for the `en_US` locale and using a provided Celsius unit:

```swift
let temperature = Measurement<UnitTemperature>(value: 36.8, unit: .celsius)
temperature.formatted()
// 98°F

temperature.formatted(.measurement(width: .abbreviated, usage: .asProvided))
// 36.8°C
```

All unit types have `general` and `asProvided` options. Some subclasses have additional options, such as the following:

[`UnitTemperature`](/documentation/Foundation/UnitTemperature)

- `person`
- `weather`

[`UnitLength`](/documentation/Foundation/UnitLength)

- `person`
- `personHeight`
- `road`

[`UnitEnergy`](/documentation/Foundation/UnitEnergy)

- `food`
- `workout`

[`UnitMass`](/documentation/Foundation/UnitMass)

- `personWeight`

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)