Instance Propertyswift 6.0.3FoundationInternationalization->FoundationEssentials
locale
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
var locale: Locale
var locale: Locale
s20FoundationEssentials7DecimalV0A20InternationalizationE11FormatStyleV8CurrencyV6localeAA6LocaleVvp
What are these?1D4C8
import FoundationEssentials
import FoundationInternationalization
struct Currency
struct Decimal
struct FormatStyle
struct Locale
Locale
encapsulates information about linguistic, cultural, and technological conventions and standards. Examples of information encapsulated by a locale include the symbol used for the decimal separator in numbers and the way dates are formatted.
init(code: String, locale: Locale = .autoupdatingCurrent)
init(from decoder: any Decoder) throws
var attributed: Decimal.FormatStyle.Attributed { get }
var currencyCode: String
var parseStrategy: Decimal.ParseStrategy<Decimal.FormatStyle.Currency> { get }
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Decimal)?
func decimalSeparator(strategy: Decimal.FormatStyle.Currency.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle.Currency
func format(_ value: Decimal) -> String
func grouping(_ group: Decimal.FormatStyle.Currency.Configuration.Grouping) -> Decimal.FormatStyle.Currency
func locale(_ locale: Locale) -> Decimal.FormatStyle.Currency
func notation(_ notation: Decimal.FormatStyle.Currency.Configuration.Notation) -> Decimal.FormatStyle.Currency
Modifies the format style to use the specified notation.
func precision(_ p: Decimal.FormatStyle.Currency.Configuration.Precision) -> Decimal.FormatStyle.Currency
func presentation(_ p: Decimal.FormatStyle.Currency.Configuration.Presentation) -> Decimal.FormatStyle.Currency
func rounded(rule: Decimal.FormatStyle.Currency.Configuration.RoundingRule = .toNearestOrEven, increment: Int? = nil) -> Decimal.FormatStyle.Currency
func scale(_ multiplicand: Double) -> Decimal.FormatStyle.Currency
func sign(strategy: Decimal.FormatStyle.Currency.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle.Currency
typealias Configuration = CurrencyFormatStyleConfiguration
typealias RegexOutput = Decimal