init(memberStyle:)
Creates an instance using the provided format style.
Declaration
init(memberStyle: Style)Parameters
- memberStyle:
The Formatstyle applied to elements of the Sequence.
Discussion
The input type of memberStyle must match the type of an element in the sequence. The output type is a string.
The following example uses a FloatingPointFormatStyle.Descriptive member style to spell out a list:
[-3.0, 9.0, 11.6].formatted(.list(memberStyle: .descriptive, type: .and))
// minus three, nine, and eleven point six