Initializerswift 6.0.3FoundationInternationalization->Swift
init(_:format:lenient:)
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
init(_ value: String, format: FloatingPointFormatStyle<Self>.Percent, lenient: Bool = true) throws
init(_ value: String, format: FloatingPointFormatStyle<Self>.Percent, lenient: Bool = true) throws
sSB30FoundationInternationalizationE_6format7lenientxSS_AA24FloatingPointFormatStyleV7PercentVyx_GSbtKcfc
What are these?3PAIM
import Swift
import FoundationInternationalization
protocol BinaryFloatingPoint : ExpressibleByFloatLiteral, FloatingPoint
A radix-2 (binary) floating-point type.
@frozen struct String
A Unicode string value that is a collection of characters.
struct FloatingPointFormatStyle<Value> where Value : BinaryFloatingPoint
struct Percent
@frozen struct Bool
A value type whose instances are either true
or false
.
init(_ value: String, format: FloatingPointFormatStyle<Self>.Currency, lenient: Bool = true) throws
init(_ value: String, format: FloatingPointFormatStyle<Self>, lenient: Bool = true) throws
Initialize an instance by parsing value
with a ParseStrategy
created with the given format
and the lenient
argument.
init<S>(_ value: S.ParseInput, strategy: S) throws where S : ParseStrategy, S.ParseOutput : BinaryFloatingPoint
Initialize an instance by parsing value
with the given strategy
.
init<S>(_ value: S.ParseInput, strategy: S) throws where Self == S.ParseOutput, S : ParseStrategy
func formatted() -> String
Format self
with FloatingPointFormatStyle()
.
func formatted<S>(_ format: S) -> S.FormatOutput where S : FormatStyle, S.FormatInput : BinaryFloatingPoint
Format self
with the given format. self
is first converted to S.FormatInput
type, then format with the given format.
func formatted<S>(_ format: S) -> S.FormatOutput where Self == S.FormatInput, S : FormatStyle
Format self
with the given format.