Number Object

eSignal EFS 2

Number Object

Top  Previous  Next

 

The Number Object in Javascript

 

Number Constructors

 

       var n = new Number( 9 );

 

typically you would just directly assign the numeric value to your variable:

 

       var n = 9;

 

 

Number Methods

 

toFixed(num)

converts a floating point number to a string with a specified number of digits

toString(radix)

converts a number to a string. radix (optional) is the base used to convert

toExponential(num)

converts a number to a string in exponential notation with num representing the number of digits after the decimal point