Number
QuickLinks
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| MAX_VALUE | number | readonly | A constant representing the largest representable number. (default: 1.7976931348623158e+308) |
| MIN_VALUE | number | readonly | A constant representing the smallest representable number. (default: 2.2250738585072014e-308) |
| NEGATIVE_INFINITY | number | readonly | A constant representing negative infinity. |
| NaN | number | readonly | A constant representing the special "Not a Number" value. (default: NaN) |
| POSITIVE_INFINITY | number | readonly | A constant representing positive infinity. |
Methods
Number Number (value:any)
Returns a new Number object set to the value of the argument converted to a number.
| Parameter | Type | Description |
|---|---|---|
| value | any | The value of the object being created. |
number toExponential (decimals:number)
Converts the Number object to a string in scientific notation.
| Parameter | Type | Description |
|---|---|---|
| decimals | number | The number of decimals. |
number toFixed (decimals:number)
Converts the Number object to a string with fixed decimals.
| Parameter | Type | Description |
|---|---|---|
| decimals | number | The number of decimals. |
number toLocaleString ()
Returns the value of a Number object converted to a string, using localized conventions.
number toPrecision (decimals:number)
Converts the Number object to a string in either scientific or fixed notation, epending on its value.
| Parameter | Type | Description |
|---|---|---|
| decimals | number | The number of decimals. |
number toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with built-in classes.
number toString (radix:number)
Returns the value of a Number object converted to a string.
| Parameter | Type | Description |
|---|---|---|
| radix | number | The optional conversion radix. |
number valueOf ()
Returns the value of a Number object as a primitive number.
Return
Number Number.Number (value:any)