How to print exponential notation of a number in Node.js

1 Answer

0 votes
const num = 762109
 
console.log(num.toExponential())
 
console.log(num.toExponential(1))
 
console.log(num.toExponential(2))
 
console.log(num.toExponential(3))
  
  
      
      
/*
run:
 
7.62109e+5
7.6e+5
7.62e+5
7.621e+5
      
*/

 



answered Aug 12, 2022 by avibootz

Related questions

1 answer 96 views
1 answer 129 views
1 answer 101 views
3 answers 288 views
1 answer 88 views
...