One Logo Pool Ball
Foundation · IOS API REFERENCE

NumberFormatStyleConfiguration.Notation

struct · iOS 15.0+ · SDK 27.1

struct Notation

A structure that an integer format style uses to configure notation.

Members (4)

get · iOS 15.0+

scientific

TypeScript
static get scientific(): NumberFormatStyleConfiguration_Notation
Swift declaration
static var scientific: NumberFormatStyleConfiguration.Notation { get }

A notation constant that formats values with scientific notation. The following example shows the effect of using scientific notation with a format style: ```swift let scientific = 12345.formatted(.number .notation(.scientific)) // 1.2345E4" ```

get · iOS 15.0+

compactName

TypeScript
static get compactName(): NumberFormatStyleConfiguration_Notation
Swift declaration
static var compactName: NumberFormatStyleConfiguration.Notation { get }

A locale-appropriate compact name notation. A compact name notation, when available in the format style's locale, that uses prefixes or suffixes corresponding to powers of ten. The following example shows a compact name notation in the `fr_FR` locale: ```swift let compactNameFormatted = 1234.formatted(.number .locale(Locale(identifier: "fr_FR")) .notation(.compactName)) // "1,2 k" ``` - note: We do not support parsing a number string containing localized prefixes or suffixes.

get · iOS 15.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 15.0+

automatic

TypeScript
static get automatic(): NumberFormatStyleConfiguration_Notation
Swift declaration
static var automatic: NumberFormatStyleConfiguration.Notation { get }

A notation that automatically provides locale-appropriate behavior.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →