API / geotoolkit / util / Locale / Locale
Defines locale class, which contains information for formatting numbers, dates and time.
The setDefault() function explained below, sets up your locale and then it will use it by default for all formatters.
To create a custom format or change format without specifying 'local' of a country you can use DecimalFormat
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
locale | string | The name of the locale |
numberformat | NumberFormatInfo | Defines number format |
numberformat-dec | string | Defines decimal symbol |
numberformat-group | string | Defines group symbol |
numberformat-infinity | string | Defines infinity text |
numberformat-neg | string | Defines negative symbol |
Methods
▸ getClassName(): string
string
▸ getLocaleName(): string
Return a name of the locale
string
▸ getNumberFormatInfo(): NumberFormatInfo
Return number format
defines number format
▸ getProperties(): Required<Options>
Returns the properties pertaining to Locale
Required<Options>
object containing locale properties
▸ setProperties(options?): Locale
Sets the properties pertaining to Locale
| Name | Type | Description |
|---|---|---|
Optional options | Options | object containing locale properties |
▸ Static getClassName(): string
string
▸ Static getDefault(): Locale
Return default locale
default locale
▸ Static getLocale(locale): Locale
| Name | Type | Description |
|---|---|---|
locale | string | current locale |
▸ Static setDefault(locale): void
Sets default locale. Once user sets a default locale here it will be used by default for all formatters in all the plots.
Please refer to the example below
Example
import {Locale} from '@int/geotoolkit/util/Locale';
Locale.setDefault(Locale.getLocale('ru'));| Name | Type | Description |
|---|---|---|
locale | Locale | default locale. It supports ['ae', 'au', 'ca', 'cn', 'eg', 'gb', 'hk', 'il', 'in', 'jp', 'sk', 'th', 'tw', 'us', 'at', 'br', 'de', 'dk', 'es', 'gr', 'it', 'nl', 'pt', 'tr', 'vn', 'bg', 'cz', 'fi', 'fr', 'no', 'pl', 'ru', 'se', 'ch'] |
void