EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > References > JavaScript > Number Object


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  JavaScript Objects :
NUMBER OBJECT








Core ObjectNNIEECMA
 Number Object for primitive numeric values.3+3+ECMA 1
 
MethodsNNIEECMA
 toLocaleString() String value of a Number object, in local value format.n/a3+ECMA 1
 toString() Returns a string representing the object.3+3+ECMA 1
 valueOf() The numeric value. (no effect for Number objects.)2+4+ECMA 1
 
PropertiesNNIEECMA
 constructor Reference to the function that created an object.2+4+ECMA 1
 MAX_VALUE Largest number representable. (~1.79E+308).3+3+ECMA 1
 MIN_VALUE Smallest number representable. (~5.00E-324)3+3+ECMA 1
 NaN Special "not a number" value.3+3+ECMA 1
 NEGATIVE_INFINITY Negative infinity, displayed as "-Infinity".3+3+ECMA 1
 POSITIVE_INFINITY Positive infinity, displayed as "Infinity".3+3+ECMA 1
 prototype Creates a new method for Number objects2+4+ECMA 1





 Number Core object 
 Object for primitive numeric values.
 
Syntax:

  numberObject=new Number(value);
 
Browser support:
 Microsoft Internet Explorer: 3+
 Netscape Browser: 3+
 
Implementations:
 JavaScript 1.2 (by Netscape)
 JScript 1 (by Microsoft)
 ECMA Script 1 (ECMA Standard)
 
 
Example:

Example :

  // The following example creates a Number object, myNum,
  // then adds a description property to all Number objects.
  // Then a value is assigned to the myNum object's description property.
 
  myNum = new Number(65);
  Number.prototype.description=null;
  myNum.description="wind speed"
  alert('The '+myNum.description+' is: '+myNum);
 
  // Would alert: The wind speed is 65



















DEVELOPER TIP!
FACT:
The scrollbar takes up about 30 pixels.
TIP:
If you're designing for an 800px screen width don't use more than 770 pixels!





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho