CodesJava

Easy learning with example program codes

JavaScript Number toExponential() method

The JavaScript number toExponential() method is used to get the string that represents exponential notation of a number.

Syntax:

Number.toExponential(n) 

Parameters
n: It represents the number of digits after decimal point. It is optional parameter.

Returns
Exponential notation of a number as string.

Example

<!DOCTYPE html>
<html>
<body>
<script>  
var n= 12.334;    
document.writeln(n.toExponential());  
</script>  
</body>
</html>

Output

1.2334e+1
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status