in Swift, use
formattedmethods directly on the types you want to format, optionally usingFormatStyleand its subtypes to customize formatter output. This approach supports dates, integers, floating-point numbers, measurements, sequences, and person name components. Foundation caches identically-configured formatter instances internally, allowing you to focus on your app’s formatting needs.Data Formatting | Apple Developer Documentation https://developer.apple.com/documentation/foundation/data_formatting
Decimal.FormatStyle(viaParseableFormatStyle)Decimal.FormatStyle.AttributedDecimal.FormatStyle.Currency(viaParseableFormatStyle)Decimal.FormatStyle.Percent(viaParseableFormatStyle)FloatingPointFormatStyle(viaParseableFormatStyle)FloatingPointFormatStyle.AttributedFloatingPointFormatStyle.Currency(viaParseableFormatStyle)FloatingPointFormatStyle.Percent(viaParseableFormatStyle)IntegerFormatStyle(viaParseableFormatStyle)IntegerFormatStyle.AttributedIntegerFormatStyle.Currency(viaParseableFormatStyle)IntegerFormatStyle.Percent(viaParseableFormatStyle)
Date.FormatStyle(viaParseableFormatStyle)Date.AttributedStyleDate.ISO8601FormatStyle(viaParseableFormatStyle)Date.VerbatimFormatStyle(viaParseableFormatStyle)Date.RelativeFormatStyleDate.IntervalFormatStyleDate.ComponentsFormatStyleDuration.TimeFormatStyleDuration.UnitsFormatStyle- (StoreKit)
Product.SubscriptionPeriod.Unit.FormatStyle