JavaScript toExponential() Method
JavaScript Number Object
Definition and Usage
The toExponential() method converts a number into an exponential notation.
Syntax
| Parameter |
Description |
| x |
Optional. An integer between 0 and 20 representing the number of digits
in the notation after the decimal point. If omitted, it is set to as many
digits as necessary to represent the value |
Browser Support

The toExponential() method is supported in all major browsers.
Example
Example
Convert a number into an exponential notation:
<script type="text/javascript">
var num = new Number(13.3714);
document.write(num.toExponential()+"<br />");
document.write(num.toExponential(2)+"<br />");
document.write(num.toExponential(3)+"<br />");
document.write(num.toExponential(10));
</script>
|
The output of the code above will be:
Try it yourself »
|
JavaScript Number Object
Create a free Flash website with our simple, online web design editing platform. Stunning templates
and user-friendly tools make website building easy and fun.
Start Creating your free website now!

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 code for recurrent conversions.
New features in Version 2010!
- 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
- Available in 32-bit and 64-bit versions
Download a fully-functional trial today!
|
|
|
|