StructureFoundationInternationalization
Decimal.FormatStyle.Percent
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 percentage values and their textual representations.
struct Percent
Topics
Initializers
init(locale: Locale)Creates a decimal percent format style that uses the given locale.
Instance Properties
var attributed: Decimal.FormatStyle.AttributedAn attributed format style based on the decimal percent format style.var locale: LocaleThe locale of the format style.
Instance Methods
func decimalSeparator(strategy: Decimal.FormatStyle.Percent.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle.PercentModifies the format style to use the specified decimal separator display strategy.func format(Decimal) -> StringFormats a decimal value as a percentage, using this style.func grouping(Decimal.FormatStyle.Percent.Configuration.Grouping) -> Decimal.FormatStyle.PercentModifies the format style to use the specified grouping.func locale(Locale) -> Decimal.FormatStyle.PercentModifies the format style to use the specified locale.func notation(Decimal.FormatStyle.Percent.Configuration.Notation) -> Decimal.FormatStyle.PercentModifies the format style to use the specified notation.func precision(Decimal.FormatStyle.Percent.Configuration.Precision) -> Decimal.FormatStyle.PercentModifies the format style to use the specified precision.func rounded(rule: Decimal.FormatStyle.Percent.Configuration.RoundingRule, increment: Int?) -> Decimal.FormatStyle.PercentModifies the format style to use the specified rounding rule and increment.func scale(Double) -> Decimal.FormatStyle.PercentModifies the format style to use the specified scale.func sign(strategy: Decimal.FormatStyle.Percent.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle.PercentModifies 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