Contents

Measurement

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

Declaration

struct Measurement<UnitType> where UnitType : Unit

Overview

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

Measurement objects are initialized with a Unit object and double value. 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

Accessing the Value and Units

Converting to Other Units

Operating on a Measurement

Formatting a Measurement

Comparing Measurements

Using Reference Types

Type Aliases

Type Properties

Default Implementations

See Also

Essentials