Attributed
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct Attributed
struct Attributed
s20FoundationEssentials7DecimalV0A20InternationalizationE11FormatStyleV10AttributedV
What are these?66GAW
import FoundationInternationalization
import FoundationEssentials
struct FormatStyle
struct Decimal
init(from decoder: any Decoder) throws
init(locale: Locale = .autoupdatingCurrent)
var attributed: Decimal.FormatStyle.Attributed { get }
var locale: Locale
var parseStrategy: Decimal.ParseStrategy<Decimal.FormatStyle> { get }
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Decimal)?
func decimalSeparator(strategy: Decimal.FormatStyle.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle
func format(_ value: Decimal) -> String
func grouping(_ group: Decimal.FormatStyle.Configuration.Grouping) -> Decimal.FormatStyle
func locale(_ locale: Locale) -> Decimal.FormatStyle
func notation(_ notation: Decimal.FormatStyle.Configuration.Notation) -> Decimal.FormatStyle
func precision(_ p: Decimal.FormatStyle.Configuration.Precision) -> Decimal.FormatStyle
func rounded(rule: Decimal.FormatStyle.Configuration.RoundingRule = .toNearestOrEven, increment: Int? = nil) -> Decimal.FormatStyle
func scale(_ multiplicand: Double) -> Decimal.FormatStyle
func sign(strategy: Decimal.FormatStyle.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle
struct Currency
struct Percent
typealias Configuration = NumberFormatStyleConfiguration
typealias RegexOutput = Decimal
protocol Copyable
A type whose values can be implicitly or explicitly copied.
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 Escapable
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: Decimal) -> AttributedString
Returns an attributed string with NumberFormatAttributes.SymbolAttribute
and NumberFormatAttributes.NumberPartAttribute
.
func locale(_ locale: Locale) -> Decimal.FormatStyle.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.