StructureFoundationInternationalization
Decimal.FormatStyle.Currency
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A format style that converts between decimal currency values and their textual representations.
struct Currency
Topics
Initializers
init(code: String, locale: Locale)Creates a decimal currency format style that uses the given currency code and locale.
Instance Properties
var attributed: Decimal.FormatStyle.AttributedAn attributed format style based on the decimal currency format style.var currencyCode: StringThe currency code this format style uses, such asUSDorEUR.var locale: LocaleThe locale of the format style.
Instance Methods
func decimalSeparator(strategy: Decimal.FormatStyle.Currency.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified decimal separator display strategy.func format(Decimal) -> StringFormats a decimal value as a currency string, using this style.func grouping(Decimal.FormatStyle.Currency.Configuration.Grouping) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified grouping.func locale(Locale) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified locale.func notation(Decimal.FormatStyle.Currency.Configuration.Notation) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified notation.func precision(Decimal.FormatStyle.Currency.Configuration.Precision) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified precision.func presentation(Decimal.FormatStyle.Currency.Configuration.Presentation) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified presentation.func rounded(rule: Decimal.FormatStyle.Currency.Configuration.RoundingRule, increment: Int?) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified rounding rule and increment.func scale(Double) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified scale.func sign(strategy: Decimal.FormatStyle.Currency.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle.CurrencyModifies the format style to use the specified sign display strategy for displaying or omitting sign symbols.
Type Aliases
Default Implementations
Relationships
Conforms To
FormatStyleParseableFormatStyleSwift.CopyableSwift.DecodableSwift.EncodableSwift.EquatableSwift.EscapableSwift.HashableSwift.SendableSwift.SendableMetatype_StringProcessing.CustomConsumingRegexComponent_StringProcessing.RegexComponent