Number
Wraps a numeric value.
Go to Property Listing | Method Listing
Methods:
Number, toExponential, toFixed, toLocaleString, toPrecision, toSource, toString, valueOf
Property Listing
Name |
Type |
Access |
Description |
---|---|---|---|
readonly |
A constant representing the largest representable number. |
||
readonly |
A constant representing the smallest representable number. |
||
readonly |
A constant representing negative infinity. |
||
readonly |
A constant representing the special "Not a Number" value. |
||
readonly |
A constant representing positive infinity. |
Method Listing
Constructor
Number Number (value:Varies)
Returns a new Number object set to the value of the argument converted to a number.
Parameter |
Type |
Description |
---|---|---|
value |
Varies |
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 |
The number of decimals. |
Number toFixed (decimals:Number)
Converts the Number object to a string with fixed decimals.
Parameter |
Type |
Description |
---|---|---|
decimals |
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 |
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 |
The optional conversion radix. |
Number valueOf ()
Returns the value of a Number object as a primitive number.