<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FormatStyle/FormatInput",
  "metadataVersion" : "0.1.0",
  "role" : "Associated Type",
  "symbol" : {
    "kind" : "Associated Type",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11FormatStyleP0B5InputQa"
  },
  "title" : "FormatInput"
}
-->

# FormatInput

The type this format style accepts as input.

```
associatedtype FormatInput
```

## Discussion

Swift type inference uses this value to determine which static accessors are available at a given call point. For example, when you format an <doc://com.apple.documentation/documentation/Swift/Int32>, you can use the static [`number`](/documentation/Foundation/FormatStyle/number-4cj49) property that provies a `IntegerFormatStyle<Int32>`, as seen in the following example. This works because the style’s input type `IntegerFormatStyle/FormatInput` is a <doc://com.apple.documentation/documentation/Swift/BinaryInteger> generically constrained to the <doc://com.apple.documentation/documentation/Swift/Int32> type.

```swift
let perihelionDistanceToSunInKm: Int32 = 147098291
perihelionDistanceToSunInKm.formatted(.number
    .notation(.scientific)) // "1.470983E8"
```

---

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)