goog.i18n.NumberFormat |
pattern
: number | string
The number that indicates a predefined
number format pattern.
|
opt_currency
: string=
Optional international currency
code. This determines the currency code/symbol used in format/parse. If
not given, the currency code for current locale will be used.
|
opt_currencyStyle
: number=
currency style, value defined in
goog.i18n.NumberFormat.CurrencyStyle.
|
![]()
Formats exponent part of a Number.
|
code » | ||
![]()
Apply a predefined pattern for shorthand formats.
Arguments:
|
code » | ||
![]()
Apply provided pattern, result are stored in member variables.
Arguments:
|
code » | ||
![]()
Apply a predefined pattern to NumberFormat object.
Arguments:
|
code » | ||
Formats a Number to produce a string.
|
code » | ||
Gets the number on which compact formatting is currently based, or null if
no such number is set. See setBaseFormatting() for more information.
|
code » | ||
Returns the digit value of current character. The character could be either
'0' to '9', or a locale specific digit.
|
code » | ||
Gets number of significant digits to show. Only fractions will be rounded.
Returns: number
The number of significant digits to include.
|
code » | ||
![]()
Get the compact unit divisor, accounting for rounding of the quantity.
|
code » | ||
![]()
Get compact unit for a certain number of digits
|
code » | ||
Get the integer base 10 logarithm of a number.
|
code » | ||
Checks if the currency symbol comes before the value ($12) or after (12$)
Handy for applications that need to have separate UI fields for the currency
value and symbol, especially for input: Price: [USD] [123.45]
The currency symbol might be a combo box, or a label.
Returns: boolean
true if currency is before value.
|
code » | ||
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.
|
code » | ||
Parses affix part of pattern.
|
code » | ||
This function will parse a "localized" text into a Number. It needs to
handle locale specific decimal, grouping, exponent and digits.
|
code » | ||
![]()
Parses the trunk part of a pattern.
|
code » | ||
Get the plural form of a number.
|
code » | ||
![]()
Round a number into an integer and fractional part
based on the rounding rules for this NumberFormat.
Arguments:
Returns: {intValue: number, fracValue: number
} The integer and fractional
part after rounding.
|
code » | ||
Round to a certain number of significant digits.
|
code » | ||
Sets a number to base the formatting on when compact style formatting is
used. If this is null, the formatting should be based only on the number to
be formatting.
This base formatting number can be used to format the target number as
another number would be formatted. For example, 100,000 is normally formatted
as "100K" in the COMPACT_SHORT format. To instead format it as '0.1M', the
base number could be set to 1,000,000 in order to force all numbers to be
formatted in millions. Similarly, 1,000,000,000 would normally be formatted
as '1B' and setting the base formatting number to 1,000,000, would cause it
to be formatted instead as '1,000M'.
Arguments:
Returns: !goog.i18n.NumberFormat
Reference to this NumberFormat object.
|
code » | ||
Sets maximum number of fraction digits.
Arguments:
Returns: !goog.i18n.NumberFormat
Reference to this NumberFormat object.
|
code » | ||
Sets minimum number of fraction digits.
Arguments:
Returns: !goog.i18n.NumberFormat
Reference to this NumberFormat object.
|
code » | ||
Sets whether trailing fraction zeros should be shown when significantDigits_
is positive. If this is true and significantDigits_ is 2, 1 will be formatted
as '1.0'.
Arguments:
Returns: !goog.i18n.NumberFormat
Reference to this NumberFormat object.
|
code » | ||
Sets number of significant digits to show. Only fractions will be rounded.
Arguments:
Returns: !goog.i18n.NumberFormat
Reference to this NumberFormat object.
|
code » | ||
![]()
Formats Number in exponential format.
|
code » | ||
![]()
Formats a Number in fraction format.
|
code » |
![]()
The number to base the formatting on when using compact styles, or null
if formatting should not be based on another number.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
Whether to show trailing zeros in the fraction when significantDigits_ is
positive.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » |
Return if Ascii digits is enforced.
Returns: boolean
If Ascii digits is enforced.
|
code » | ||
![]()
Set if the usage of Ascii digits in formatting should be enforced.
Arguments:
|
code » |
![]()
Alias for the compact format 'unit' object.
|
Code » | |
![]()
The empty unit, corresponding to a base of 0.
|
Code » | |
![]()
A quote character.
|
Code » | |
![]()
A decimal separator character.
|
Code » | |
![]()
A digit character.
|
Code » | |
![]()
An exponent character.
|
Code » | |
![]()
A grouping separator character.
|
Code » | |
![]()
A minus character.
|
Code » | |
![]()
A percent character.
|
Code » | |
![]()
A per mille character.
|
Code » | |
![]()
An plus character.
|
Code » | |
![]()
A separator character.
|
Code » | |
![]()
A zero digit character.
|
Code » | |
![]()
A quote character.
|
Code » | |
![]()
If the usage of Ascii digits should be enforced.
|
Code » |
![]()
Compacting styles.
Constants:
|
Code » | |||||||
![]()
Currency styles.
Constants:
|
Code » | |||||||
![]()
Standard number formatting patterns.
Constants:
|
Code » |