How to convert a String containing Scientific Notation to correct JavaScript number format?

JavascriptWeb DevelopmentFront End Technology

To convert a string with Scientific Notation, use the Number function. Pass the value to this function.

Example

You can try to run the following code to convert a string to correct number format −

Live Demo

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("String with Scientific Notation converted below:<br>");
         document.write(Number("7.53245683E7"));
      </script>
   </body>
</html>

Output

String with Scientific Notation converted below:
75324568.3
raja
Published on 03-Feb-2018 12:49:14
Advertisements