StructureFoundationEssentials
Decimal.FormatStyle
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A structure that converts between decimal values and their textual representations.
struct FormatStyle
Topics
Structures
struct AttributedA format style that converts decimal values into attributed strings.struct CurrencyA format style that converts between decimal currency values and their textual representations.struct PercentA format style that converts between decimal percentage values and their textual representations.
Initializers
init(locale: Locale)Creates a decimal format style that uses the given locale.
Instance Properties
var attributed: Decimal.FormatStyle.AttributedAn attributed format style based on the decimal format style.var locale: LocaleThe locale of the format style.
Instance Methods
func decimalSeparator(strategy: Decimal.FormatStyle.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyleModifies the format style to use the specified decimal separator display strategy.func format(Decimal) -> StringFormats a decimal value using this style.func grouping(Decimal.FormatStyle.Configuration.Grouping) -> Decimal.FormatStyleModifies the format style to use the specified grouping.func locale(Locale) -> Decimal.FormatStyleModifies the format style to use the specified locale.func notation(Decimal.FormatStyle.Configuration.Notation) -> Decimal.FormatStyleModifies the format style to use the specified notation.func precision(Decimal.FormatStyle.Configuration.Precision) -> Decimal.FormatStyleModifies the format style to use the specified precision.func rounded(rule: Decimal.FormatStyle.Configuration.RoundingRule, increment: Int?) -> Decimal.FormatStyleModifies the format style to use the specified rounding rule and increment.func scale(Double) -> Decimal.FormatStyleModifies the format style to use the specified scale.func sign(strategy: Decimal.FormatStyle.Configuration.SignDisplayStrategy) -> Decimal.FormatStyleModifies 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