---
title: "format(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/duration/unitsformatstyle/format(_:)"
---

# format(_:)

Creates a locale-aware string representation from a duration value.

## Declaration

```swift
func format(_ duration: Duration) -> String
```

## Parameters

- `duration`: The value to format.

## Return Value

Return Value A string representation of the duration.
