# Class FormatSettings

Settings that affect how values are formatted.

#### Hierarchy (view full)

- Settings<FormatSettingsProperties>
  - FormatSettings

#####
Index

### Constructors

constructor

### Properties

_handles
@eventTypes

### Accessors

currency
dateFormat
fractionalDigits
locale
numberFormat
parent
timeFormat
timeZone
useFieldInfo

### Methods

_getCollectionSetting
_getNestedSettings
_getSerializableProperties
_getSetting
_hasSettingIncludingAncestor
_setParent
_setSetting
_toPropertyDef
assignProperties
assignPropertiesAsync
destroy
finishAssignProperties
getDefault
getDefaults
getSerializableProperties
isModified
reset
toJSON

##
Constructors

### `Abstract` constructor

- new FormatSettings(...args): FormatSettings

- #### Parameters

  - `Rest`...args: [_properties?: unknown]

  #### Returns FormatSettings

  Inherited from Settings.constructor

##
Properties

### `Protected` `Readonly`_handles

_handles: Handles<unknown, ResourceHandle>

Inherited from Settings._handles

### @eventTypes

@eventTypes: SettingsEvents<FormatSettings>

#### Deprecated

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

Overrides Settings.@eventTypes

##
Accessors

### currency

- get currency(): string

- The 3-letter ISO 4217 currency code (e.g "USD", "CAD"). Required when formatting a number using NumberFormat.CURRENCY or NumberFormat.ACCOUNTING.

  #### Returns string

- set currency(value): void

- #### Parameters

  - value: string

  #### Returns void

### dateFormat

- get dateFormat(): string

- The default format for date values. Either a utilities/format/formats!DateFormat constant, a custom date format string.

  #### Returns string

- set dateFormat(value): void

- #### Parameters

  - value: string

  #### Returns void

### fractionalDigits

- get fractionalDigits(): number

- The number of digits to show after the decimal point. If unspecified, an appropriate value is determined based on the locale and currency.

  #### Returns number

- set fractionalDigits(value): void

- #### Parameters

  - value: number

  #### Returns void

### locale

- get locale(): string

- The locale to use when formatting values.

  #### Returns string

- set locale(value): void

- #### Parameters

  - value: string

  #### Returns void

### numberFormat

- get numberFormat(): string

- The default format for number values. Either a utilities/format/formats!NumberFormat constant, a custom number format string.

  #### Returns string

- set numberFormat(value): void

- #### Parameters

  - value: string

  #### Returns void

### parent

- get parent(): this

- The parent settings that these settings will inherit from.

  #### Returns this

  Inherited from Settings.parent

- set parent(value): void

- #### Parameters

  - value: this

  #### Returns void

  Inherited from Settings.parent

### timeFormat

- get timeFormat(): string

- The default format for time values. Either a utilities/format/formats!TimeFormat constant, a custom time format string.

  #### Returns string

- set timeFormat(value): void

- #### Parameters

  - value: string

  #### Returns void

### timeZone

- get timeZone(): string

- The time zone to display date/time data in. The default will be the user's local time zone.

  #### Returns string

- set timeZone(value): void

- #### Parameters

  - value: string

  #### Returns void

### useFieldInfo

- get useFieldInfo(): boolean

- Whether to use formatting from the field info if it is specified.

  #### Returns boolean

- set useFieldInfo(value): void

- #### Parameters

  - value: boolean

  #### Returns void

##
Methods

### `Protected`_getCollectionSetting

- _getCollectionSetting<T>(setting): Collection<T>

- Gets the value for a setting that represents a collection.

  #### Type Parameters

  - T

  #### Parameters

  - setting: keyof FormatSettings

    The setting name.

  #### Returns Collection<T>

  Inherited from Settings._getCollectionSetting

### `Protected`_getNestedSettings

- _getNestedSettings<T>(setting, factory): T

- Gets a property which is itself an instance of Settings.

  #### Type Parameters

  - T extends Settings<unknown>

  #### Parameters

  - setting: keyof FormatSettings

    The setting name.

  - factory: (() => T)

    A factory for creating the nested settings.

    - - (): T

      - #### Returns T

  Inherited from Settings._getNestedSettings

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<FormatSettingsProperties>

- The property keys and their metadata that are used to implement serializing and deserializing the class instance.

  #### Returns PropertyDefs<FormatSettingsProperties>

  Overrides Settings._getSerializableProperties

### `Protected`_getSetting

- _getSetting<K>(setting, defaultValue?): FormatSettings[K]

- Gets the value for a setting.

  #### Type Parameters

  - K extends keyof FormatSettings

  #### Parameters

  - setting: K

    The setting name.

  - `Optional` defaultValue: FormatSettings[K]

    The default value if the setting is not explicitly set.

  #### Returns FormatSettings[K]

  Inherited from Settings._getSetting

### `Protected`_hasSettingIncludingAncestor

- _hasSettingIncludingAncestor<K>(setting): boolean

- Determines whether the specified setting has been modified locally or by any parent of the current settings instance.

  #### Type Parameters

  - K extends keyof FormatSettings

  #### Parameters

  - setting: K

    The setting to check.

  #### Returns boolean

  Overrides Settings._hasSettingIncludingAncestor

### `Protected`_setParent

- _setParent(parent): void

- Sets the parent settings that these settings will inherit from.

  #### Parameters

  - parent: FormatSettings

    The parent settings to inherit from.

  #### Returns void

  Inherited from Settings._setParent

### `Protected`_setSetting

- _setSetting<K>(setting, value): void

- Sets the value for a setting. This will override any inherited value for the setting.

  #### Type Parameters

  - K extends keyof FormatSettings

  #### Parameters

  - setting: K

    The setting name.

  - value: FormatSettings[K]

    The setting value.

  #### Returns void

  Inherited from Settings._setSetting

### `Protected`_toPropertyDef

- _toPropertyDef<T>(def): PropertyDef<T>

- Converts the value to a PropertyDef object.

  #### Type Parameters

  - T

  #### Parameters

  - def: PropertyDefSerializeMode | PropertyDefSerializeMode[] | PropertyDef<T>

    The value to convert.

  #### Returns PropertyDef<T>

  Inherited from Settings._toPropertyDef

### assignProperties

- assignProperties(properties): void

- #### Parameters

  - properties: Partial<unknown>

  #### Returns void

  #### Inherit Doc

  Inherited from Settings.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- #### Parameters

  - properties: Partial<unknown>

  #### Returns Promise<void>

  #### Inherit Doc

  Inherited from Settings.assignPropertiesAsync

### destroy

- destroy(): void

- #### Returns void

  Inherited from Settings.destroy

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- #### Returns Promise<void>

  #### Inherit Doc

  Inherited from Settings.finishAssignProperties

### getDefault

- getDefault<K>(key): unknown

- #### Type Parameters

  - K extends never

  #### Parameters

  - key: K

  #### Returns unknown

  #### Inherit Doc

  Inherited from Settings.getDefault

### getDefaults

- getDefaults(): FormatSettingsProperties

- #### Returns FormatSettingsProperties

  #### Inherit Doc

  Inherited from Settings.getDefaults

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<unknown>

- Returns the serializable properties.

  #### Parameters

  - serializeMode: SerializeMode = "all"

    Optional. If specified, only properties that support the given serialization mode will be returned.

  #### Returns PropertyDefs<unknown>

  Inherited from Settings.getSerializableProperties

### isModified

- isModified(): boolean

- Determines whether the settings have been locally modified in any way.

  #### Returns boolean

  Inherited from Settings.isModified

- isModified(setting): boolean

- Determines whether the specified setting has been locally modified, and is thus overriding any inherited value.

  #### Parameters

  - setting: keyof FormatSettings

    The setting to check.

  #### Returns boolean

  Inherited from Settings.isModified

### reset

- reset(): void

- Removes all local overrides, resetting all settings to their inherited values, if any.

  #### Returns void

  Inherited from Settings.reset

- reset(setting): void

- Removes a local override for a setting and resets it to its inherited value, if any.

  #### Parameters

  - setting: keyof FormatSettings

    The setting to reset.

  #### Returns void

  Inherited from Settings.reset

### toJSON

- toJSON(serializeMode?): FormatSettingsProperties

- #### Parameters

  - serializeMode: SerializeMode = "all"

  #### Returns FormatSettingsProperties

  #### Inherit Doc

  Inherited from Settings.toJSON