Number

Wraps a numeric value.

Methods:

Number, toExponential, toFixed, toLocaleString, toPrecision, toSource, toString, valueOf

Property Listing

Name

Type

Access

Description

MAX_VALUE

Number

readonly

A constant representing the largest representable number.

MIN_VALUE

Number

readonly

A constant representing the smallest representable number.

NEGATIVE_INFINITY

Number

readonly

A constant representing negative infinity.

NaN

Number

readonly

A constant representing the special "Not a Number" value.

POSITIVE_INFINITY

Number

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

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.