<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 10.0.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Measurement",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11MeasurementV"
  },
  "title" : "Measurement"
}
-->

# Measurement

A numeric quantity labeled with a unit of measure, with support for unit conversion and unit-aware calculations.

```
struct Measurement<UnitType> where UnitType : Unit
```

## Overview

A [`Measurement`](/documentation/Foundation/Measurement) object represents a quantity and unit of measure. The [`Measurement`](/documentation/Foundation/Measurement) type provides a programmatic interface to converting measurements into different units, as well as calculating the sum or difference between two measurements.

[`Measurement`](/documentation/Foundation/Measurement) objects are initialized with a [`Unit`](/documentation/Foundation/Unit) object and double value. [`Measurement`](/documentation/Foundation/Measurement) objects are immutable, and cannot be changed after being created.

Measurements support a large set of operators, including `+`, `-`, `*`, `/`, and a full set of comparison operators.

## Topics

### Creating a Measurement

[`init(value:unit:)`](/documentation/Foundation/Measurement/init(value:unit:))

Create a `Measurement` given a specified value and unit.

### Accessing the Value and Units

[`unit`](/documentation/Foundation/Measurement/unit)

The unit component of the measurement.

[`value`](/documentation/Foundation/Measurement/value)

The value component of the measurement.

### Converting to Other Units

[`convert(to:)`](/documentation/Foundation/Measurement/convert(to:))

Converts the measurement to the specified unit.

[`converted(to:)`](/documentation/Foundation/Measurement/converted(to:))

Returns a new measurement created by converting to the specified unit.

### Operating on a Measurement

[`*(_:_:)`](/documentation/Foundation/Measurement/*(_:_:)-1d26c)

Multiply a scalar value by a measurement.

[`*(_:_:)`](/documentation/Foundation/Measurement/*(_:_:)-5tv8a)

Multiply a measurement by a scalar value.

[`+(_:_:)`](/documentation/Foundation/Measurement/+(_:_:)-9lejn)

Add two measurements.

[`+(_:_:)`](/documentation/Foundation/Measurement/+(_:_:)-4fsbl)

Adds two measurements of the same dimension.

[`-(_:_:)`](/documentation/Foundation/Measurement/-(_:_:)-2nnoy)

Subtract two measurements of the same Unit.

[`-(_:_:)`](/documentation/Foundation/Measurement/-(_:_:)-1a47h)

Subtract two measurements of the same Dimension.

[`/(_:_:)`](/documentation/Foundation/Measurement/_(_:_:)-98s40)

Divide a scalar value by a measurement.

[`/(_:_:)`](/documentation/Foundation/Measurement/_(_:_:)-71kwk)

Divide a measurement by a scalar value.

### Formatting a Measurement

[`formatted()`](/documentation/Foundation/Measurement/formatted())

Generates a locale-aware string representation of a measurement using the default measurement format style.

[`formatted(_:)`](/documentation/Foundation/Measurement/formatted(_:))

Generates a locale-aware string representation of a measurement using the provided measurement format style.

[`Measurement.FormatStyle`](/documentation/Foundation/Measurement/FormatStyle)

A type that provides localized representations of measurements.

[`Measurement.AttributedStyle`](/documentation/Foundation/Measurement/AttributedStyle)

A type that provides localized representations of measurements with an attributed string.

### Comparing Measurements

[`<(_:_:)`](/documentation/Foundation/Measurement/_(_:_:)-7pou4)

Compare two measurements of the same `Unit`.

### Creating Ranges of Measurements

### Using Reference Types

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

A numeric quantity labeled with a unit of measure, with support for unit conversion and unit-aware calculations.



---

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)