Formatter.number Class
Number formatter.
Item Index
Methods
- toDecimal static
- toHexExp static
- toScientific static
Methods
toDecimal
(
String
static
-
arg -
[options]
Returns a string representing the given number in decimal form.
Parameters:
-
argAnyNumber compatible value to be formatted
-
[options]Object optionalFormatting options. Default values:
{ precision: undefined, // Number of significant fractional digits. Data // type limited for falsy values other than 0. considerZeroSign: false // Whether to return a sign for negative zero or not }
Returns:
String:
toHexExp
(
String
static
-
arg
Returns the given number in hexadecimal exponential form.
Details on hexadecimal exponential encoding:
Parameters:
-
argAnyNumber compatibel argument
Returns:
String:
Hex exponential form of the given string
toScientific
(
String
static
-
arg -
[options]
Returns a string representing the given number in scientific notation.
Parameters:
-
argAnyNumber compatible value to be formatted
-
[options]Object optionalFormatting options. Default values:
{ precision: undefined, // Mantissa precision. Data type limited for falsy // values other than 0. expMinWidth: 1, // Min width of the exponent (excl. 'e' and sign). upperCase: false, // Whether to use 'e' or 'E' for the exponent. considerZeroSign: false // Whether to return a sign for negative zero or not }
Returns:
String:
