---
title: "formatted(_:)"
framework: Swift
role: symbol
role_heading: Instance Method
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+, macOS 12.0+, tvOS 15.0+, visionOS 1.0+, watchOS 8.0+]
path: swift/binaryinteger/3765927-formatted
---

# formatted(_:)

Format `self` with the given format. `self` is first converted to `S.FormatInput` type, then format with the given format.

## Declaration

```swift
func formatted<S>(_ format: S) -> S.FormatOutput where S : FormatStyle, S.FormatInput : BinaryInteger
```
