One Logo Pool Ball
Foundation · IOS API REFERENCE

Decimal.FormatStyle.Attributed

struct · iOS 15.0+ · SDK 27.1

struct Attributed

A format style that converts decimal values into attributed strings. Use the ``Decimal/FormatStyle/attributed`` modifier on a ``Decimal/FormatStyle`` to create a format style of this type. The attributed strings that this format style creates contain attributes from the ``AttributeScopes/FoundationAttributes/NumberFormatAttributes`` attribute scope. Use these attributes to determine which runs of the attributed string represent different parts of the formatted value.

Members (2)

method · iOS 15.0+

format

TypeScript
format(value: Decimal): AttributedString
Swift declaration
func format(_ value: Decimal) -> AttributedString

Formats a decimal value, using this style. - Parameter value: The decimal value to format. - Returns: An attributed string representation of `value`, formatted according to the style's configuration. The returned string contains attributes from the ``AttributeScopes/FoundationAttributes/NumberFormatAttributes`` attribute scope to indicate runs formatted by this format style.

method · iOS 15.0+

locale

TypeScript
locale(locale: Locale): Decimal_FormatStyle_Attributed
Swift declaration
func locale(_ locale: Locale) -> Decimal.FormatStyle.Attributed

Modifies the format style to use the specified locale. - Parameter locale: The locale to apply to the format style. - Returns: A format style that uses the specified locale.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →