Skip to content

InitializerFoundationEssentials

init(string:locale:)

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
Creates and initializes a decimal by parsing a string according to the provided locale’s conventions.
init?(string: String, locale: Locale? = nil)

Parameters

string

A string containing a formatted decimal value.

locale

A locale that indicates the formatting conventions used by string.