Javascript numbers reference.

Javascript build-in Number object reference.

Create numbers:

Prototype Methods:

Syntax: toExponential(fractionDigits)
The method will return the number in an exponential form with a digit before the comma and "fractionDigits" digits after the comma.

The fractional part of the number is rounded upward.

Return value: A string.
fractionDigits: The number of digits (0 - 20) that you want after the decimal point.

If the argument is omitted, then a number of decimal places as necessary will be used.

An example of using the toExponential() :

Prototype Properties:

Syntax: Number.prototype.constructor
This property of the Number.prototype holds the reference back to the Number object.

You can find all the Number constants through this constructor. (Number.prototype.constructor.MAX_VALUE is the same as Number.MAX_VALUE)

Important note: This is the same as the constructor property of an instantiated object

Constructor (Number) Properties:

Syntax: Number.constructor
The constructor property is a reference to the function that will be invoked to create a Number object.

Constructor (Number) Constants:

Number.MAX_VALUE: Largest representable number. (1.7976931348623157e+308)
Number.MIN_VALUE: Smallest (closest to zero) representable number. (5e-324)
Number.NaN: Special Not-a-Number value. (NaN)
Number.POSITIVE_INFINITY: Special value to represent infinity. (Infinity)
Number.NEGATIVE_INFINITY: Special value to represent negative infinity. (-Infinity)

© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.