Last updated

API / geotoolkit / util / AutoNumberFormat / AutoNumberFormat

Class: AutoNumberFormat

util.AutoNumberFormat.AutoNumberFormat

Define the proper number format for a double value formatted for DISPLAY only.

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
fulllocalebooleanSpecify format how to provide locale
grouplengthnumberSpecify group length of numbers
localestringFormat locale
localeLocaleFormat locale
locale-localestringThe name of the locale
locale-numberformatNumberFormatInfoDefines number format
locale-numberformat-decstringDefines decimal symbol
locale-numberformat-groupstringDefines group symbol
locale-numberformat-infinitystringDefines infinity text
locale-numberformat-negstringDefines negative symbol
maximumfractiondigitsnumberSpecify maximum fraction digits
minimumfractiondigitsnumberSpecify minimum fraction digits, have to be less or equal to maximumfractiondigits
roundbooleanRound number

Contents

Constructors

new AutoNumberFormat(options)

new AutoNumberFormat(options?)

Parameters

Name Type
Optional optionsOptions

Overrides

NumberFormat.constructor

Methods

clone

clone(): Format

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

Format

clone

Inherited from

NumberFormat.clone


copyConstructor

Protected copyConstructor(src): AutoNumberFormat

copy constructor

Parameters

Name Type Description
srcAutoNumberFormatSource to copy from

Returns

AutoNumberFormat

Overrides

NumberFormat.copyConstructor


format

format(number): string

Formats number to string

Parameters

Name Type Description
numbernumbernumber to be formatted

Returns

string

Overrides

NumberFormat.format


getClassName

getClassName(): string

Returns

string

Inherited from

NumberFormat.getClassName


getLocalFormatData

Protected getLocalFormatData(locale?): NumberFormatInfo

Return object, which contains 'dec', 'group', 'neg' symbols

Parameters

Name Type Description
Optional localestring | Localelocale

Returns

NumberFormatInfo

Inherited from

NumberFormat.getLocalFormatData


getLocale

getLocale(): Locale

Return the current locale

Returns

Locale

Inherited from

NumberFormat.getLocale


getMaximumFractionDigits

getMaximumFractionDigits(number?): number

Return maximum faction digits

Parameters

Name Type Description
Optional numbernumberan optional number to get maximum fraction digits

Returns

number

Overrides

NumberFormat.getMaximumFractionDigits


getMinimumFractionDigits

getMinimumFractionDigits(number?): number

Return minimum faction digits

Parameters

Name Type Description
Optional numbernumberan optional number to get minimum fraction digits

Returns

number

Inherited from

NumberFormat.getMinimumFractionDigits


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties pertaining to this object

Inherited from

NumberFormat.getProperties


setLocale

setLocale(locale): AutoNumberFormat

Sets locale

Parameters

Name Type Description
localestring | Localelocale

Returns

AutoNumberFormat

this

Inherited from

NumberFormat.setLocale


setMaximumFractionDigits

setMaximumFractionDigits(digits): AutoNumberFormat

Return maximum fraction digits

Parameters

Name Type Description
digitsnumbermaximum fraction digits

Returns

AutoNumberFormat

this

Inherited from

NumberFormat.setMaximumFractionDigits


setMinimumFractionDigits

setMinimumFractionDigits(digits): AutoNumberFormat

Return minimum fraction digits

Parameters

Name Type Description
digitsnumberminimum fraction digits

Returns

AutoNumberFormat

this

Inherited from

NumberFormat.setMinimumFractionDigits


setProperties

setProperties(properties?): AutoNumberFormat

Sets properties

Parameters

Name Type Description
Optional propertiesOptionsproperties pertaining to this object

Returns

AutoNumberFormat

this

Inherited from

NumberFormat.setProperties


toFixed

Protected toFixed(number, decimalPlaces?): string

Convert number to format with fixed point

Parameters

Name Type Description
numbernumbernumber to be converted
Optional decimalPlacesnumbernumber of decimal places this number can have

Returns

string

Inherited from

NumberFormat.toFixed


estimateMaximumFractionDigits

Static estimateMaximumFractionDigits(number): number

Estimate the maximum fraction digits

Parameters

Name Type Description
numbernumbernumber to provide the estimate

Returns

number


getClassName

Static getClassName(): string

Returns

string

Inherited from

NumberFormat.getClassName


getInstance

Static getInstance(locale?): NumberFormat

Return instance of the number format

Parameters

Name Type Description
Optional localestringlocale of formatter. Locals is not supported for now.

Returns

NumberFormat

instance of the number format

Inherited from

NumberFormat.getInstance


matchFormat

Static matchFormat(number): NumberFormat

Creates format NumberFormat based on specified value

Parameters

Name Type Description
numbernumbernumber to provide the best format

Returns

NumberFormat