API / geotoolkit / util / AutoNumberFormat / AutoNumberFormat
util.AutoNumberFormat.AutoNumberFormat
Define the proper number format for a double value formatted for DISPLAY only.
↳
AutoNumberFormat
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
fulllocale | boolean | Specify format how to provide locale |
grouplength | number | Specify group length of numbers |
locale | string | Format locale |
locale | Locale | Format locale |
locale-locale | string | The name of the locale |
locale-numberformat | NumberFormatInfo | Defines number format |
locale-numberformat-dec | string | Defines decimal symbol |
locale-numberformat-group | string | Defines group symbol |
locale-numberformat-infinity | string | Defines infinity text |
locale-numberformat-neg | string | Defines negative symbol |
maximumfractiondigits | number | Specify maximum fraction digits |
minimumfractiondigits | number | Specify minimum fraction digits, have to be less or equal to maximumfractiondigits |
round | boolean | Round number |
Constructors
• new AutoNumberFormat(options?)
| Name | Type |
|---|---|
Optional options | Options |
NumberFormat.constructor
Methods
▸ clone(): Format
All inheritors should implement copy constructor or provide custom implementation for this method
clone
▸ Protected copyConstructor(src): AutoNumberFormat
copy constructor
| Name | Type | Description |
|---|---|---|
src | AutoNumberFormat | Source to copy from |
▸ format(number): string
Formats number to string
| Name | Type | Description |
|---|---|---|
number | number | number to be formatted |
string
▸ getClassName(): string
string
▸ Protected getLocalFormatData(locale?): NumberFormatInfo
Return object, which contains 'dec', 'group', 'neg' symbols
| Name | Type | Description |
|---|---|---|
Optional locale | string | Locale | locale |
NumberFormat.getLocalFormatData
▸ getLocale(): Locale
Return the current locale
▸ getMaximumFractionDigits(number?): number
Return maximum faction digits
| Name | Type | Description |
|---|---|---|
Optional number | number | an optional number to get maximum fraction digits |
number
NumberFormat.getMaximumFractionDigits
▸ getMinimumFractionDigits(number?): number
Return minimum faction digits
| Name | Type | Description |
|---|---|---|
Optional number | number | an optional number to get minimum fraction digits |
number
NumberFormat.getMinimumFractionDigits
▸ getProperties(): OptionsOut
Gets all the properties pertaining to this object
properties pertaining to this object
▸ setLocale(locale): AutoNumberFormat
Sets locale
| Name | Type | Description |
|---|---|---|
locale | string | Locale | locale |
this
▸ setMaximumFractionDigits(digits): AutoNumberFormat
Return maximum fraction digits
| Name | Type | Description |
|---|---|---|
digits | number | maximum fraction digits |
this
NumberFormat.setMaximumFractionDigits
▸ setMinimumFractionDigits(digits): AutoNumberFormat
Return minimum fraction digits
| Name | Type | Description |
|---|---|---|
digits | number | minimum fraction digits |
this
NumberFormat.setMinimumFractionDigits
▸ setProperties(properties?): AutoNumberFormat
Sets properties
| Name | Type | Description |
|---|---|---|
Optional properties | Options | properties pertaining to this object |
this
▸ Protected toFixed(number, decimalPlaces?): string
Convert number to format with fixed point
| Name | Type | Description |
|---|---|---|
number | number | number to be converted |
Optional decimalPlaces | number | number of decimal places this number can have |
string
▸ Static estimateMaximumFractionDigits(number): number
Estimate the maximum fraction digits
| Name | Type | Description |
|---|---|---|
number | number | number to provide the estimate |
number
▸ Static getClassName(): string
string
▸ Static getInstance(locale?): NumberFormat
Return instance of the number format
| Name | Type | Description |
|---|---|---|
Optional locale | string | locale of formatter. Locals is not supported for now. |
instance of the number format
▸ Static matchFormat(number): NumberFormat
Creates format NumberFormat based on specified value
| Name | Type | Description |
|---|---|---|
number | number | number to provide the best format |