JavaScript Reference :: Number

A Number object is a wrapper for the primitive numeric values and is created by passing a numeric value to the constructor.

Number

methods

string toExponential(int significantDigits)
Returns a string containing the number in exponential form to the number of significant digits specified.
string toFixed(int significantDigits)
Returns a string containing the number in fixed-point notation with the number of digits right of the decimal point specified.
object toSource()
Returns a literal representing the source code of the object e.g "function Object() { [native code] }" or "function Car(manufactuer, model, productionyear) { this.make = manufactuer; this.model = model; this.year = productionyear; }".
string toString(int radix)
Returns a string representing the number. If radix is used, the number is calculated as base radix. The valid values for the radix parameter are 2 to 36, inclusive.
void unwatch(property)
Removes a previously set watchpoint.
								
object valueOf()
Returns the primitive value of the object e.g. "function Object() { [native code] }".
void watch(property, handlingFunction)
Calls the handlingFunction when the property is changed.
								

properties

constructor
The constructor method is the base method used to create an instance of the object.
MAX_VALUE
The maximum numeric value possible.
MIN_VALUE
The minimin numeric value possible.
NaN
The representation of a non-numeric value.
NEGATIVE_INFINITY
Negative infinity as a constant.
POSITIVE_INFINITY
Positive infinity as a constant.
prototype
Exposes the prototype for the method or property of the object.

events