JavaScript Number Object
Number Object
The Number object is an object wrapper for primitive numeric values.
Syntax
| var myNum=new Number(number); |
Note: If the number parameter cannot be converted into a number, it returns NaN.
Number Object Properties
F: Firefox, IE: Internet Explorer
| Property |
Description |
F |
IE |
| constructor |
Returns a reference to the Number function that created the object |
1 |
4 |
| MAX_VALUE |
Returns the largest possible value in JavaScript |
1 |
4 |
| MIN_VALUE |
Returns the smallest possible value in JavaScript |
1 |
4 |
| NaN |
Represents a "not-a-number" value |
1 |
4 |
| NEGATIVE_INFINITY |
Represents a value that is less than MIN_VALUE |
1 |
4 |
| POSITIVE_INFINITY |
Represents a value that is greater than MAX_VALUE |
1 |
4 |
| prototype |
Allows you to add properties and methods to an object |
1 |
4 |
Number Object Methods
| Method |
Description |
F |
IE |
| toExponential() |
Converts the value of an object into an exponential
notation |
1 |
5.5 |
| toFixed() |
Formats a number to use a specified number of decimals |
1 |
5.5 |
| toLocaleString() |
|
|
|
| toPrecision() |
Formats a number to a specified length |
1 |
5.5 |
| toString() |
Converts a number to a string |
1 |
4 |
| valueOf() |
Returns the value of a Number object |
1 |
4 |

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|