Home

Class goog.i18n.NumberFormat

Constructor of NumberFormat.

Instance Method Summary
addExponentPart_(number exponent, ?Array parts)

Formats exponent part of a Number.

applyPattern_(string pattern)

Apply provided pattern, result are stored in member variables.

applyStandardPattern_(number patternType)

Apply a predefined pattern to NumberFormat object.

format(number number) ⇒ string

Formats a Number to produce a string.

getDigit_(string ch) ⇒ number

Returns the digit value of current character. The character could be either '0' to '9', or a locale specific digit.

parse(string text, ?Array= opt_pos) ⇒ number

Parses text string to produce a Number. This method attempts to parse text starting from position "opt_pos" if it is given. Otherwise the parse will start from the beginning of the text. When opt_pos presents, opt_pos will be updated to the character next to where parsing stops after the call. If an error occurs, opt_pos won't be updated.

parseAffix_(string pattern, ?Array pos) ⇒ string

Parses affix part of pattern.

parseNumber_(string text, ?Array pos) ⇒ number

This function will parse a "localized" text into a Number. It needs to handle locale specific decimal, grouping, exponent and digits.

parseTrunk_(string pattern, ?Array pos)

Parses the trunk part of a pattern.

subformatExponential_(number number, ?Array parts)

Formats Number in exponential format.

subformatFixed_(number number, number minIntDigits, ?Array parts)

Formats a Number in fraction format.