Instance Method
format(_:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Creates a locale-aware string representation of the value.
func format(_ value: Base) -> String
Parameters
valueThe sequence of elements to format.
Return Value
A string representation of the provided sequence.
Discussion
Once you create a style, you can use it to format similar sequences multiple times. For example:
let percentStyle = ListFormatStyle<IntegerFormatStyle.Percent, [Int]>(memberStyle: .percent)
percentStyle.format([92, 98]) // 92% and 98%
percentStyle.format([67, 72, 99]) // 67%, 72%, and 99%