Attributed
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct Attributed
struct Attributed
s30FoundationInternationalization18IntegerFormatStyleV10AttributedV
What are these?7J7Y5
where Value:BinaryInteger
import FoundationInternationalization
struct IntegerFormatStyle<Value> where Value : BinaryInteger
protocol BinaryInteger : CustomStringConvertible, Hashable, Numeric, Strideable where Self.Magnitude : BinaryInteger, Self.Magnitude == Self.Magnitude.Magnitude
An integer type with a binary representation.
var parseStrategy: IntegerParseStrategy<IntegerFormatStyle<Value>> { get }
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Value)?
func format(_ value: Value) -> String
Returns a localized string for the given value. Supports up to 64-bit signed integer precision. Values not representable by Int64
are clamped.
func locale(_ locale: Locale) -> IntegerFormatStyle<Value>
struct Currency
struct Percent
typealias RegexOutput = Value
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol FormatStyle : Decodable, Encodable, Hashable
A type that can convert a given data type into a representation.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
init(from decoder: any Decoder) throws
func format(_ value: Value) -> AttributedString
Returns an attributed string with NumberFormatAttributes.SymbolAttribute
and NumberFormatAttributes.NumberPartAttribute
. Values not representable by Int64
are clamped.
func locale(_ locale: Locale) -> IntegerFormatStyle<Value>.Attributed
static func currency<Value>(code: String) -> Self where Self == FloatingPointFormatStyle<Value>.Currency, Value : BinaryFloatingPoint
static func currency<V>(code: String) -> Self where Self == IntegerFormatStyle<V>.Currency, V : BinaryInteger
static func list<MemberStyle, Base>(memberStyle: MemberStyle, type: ListFormatStyle<MemberStyle, Base>.ListType, width: ListFormatStyle<MemberStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<MemberStyle, Base>, MemberStyle : FormatStyle, Base : Sequence, MemberStyle.FormatInput == Base.Element, MemberStyle.FormatOutput == String
static func list<Base>(type: ListFormatStyle<StringStyle, Base>.ListType, width: ListFormatStyle<StringStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<StringStyle, Base>, Base : Sequence, Base.Element == String
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.