---
title: "converting(to:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmeasurement/converting(to:)"
---

# converting(to:)

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

## Declaration

```swift
func converting(to unit: Unit) -> Measurement<Unit>
```

## Parameters

- `unit`: The unit to convert the measurement into.

## Return Value

Return Value A new measurement with a value calculated by converting into the new unit.

## Discussion

Discussion This method raises an invalidArgumentException if the receiver cannot be converted to unit.

## See Also

### Converting to Other Units

- [canBeConverted(to:)](foundation/nsmeasurement/canbeconverted(to:).md)
