Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  46] [ 4]  / answers: 1 / hits: 30002  / 12 Years ago, wed, june 20, 2012, 12:00:00

I want to make a function that takes an entered value and converts it to scientific notation (N x 10^a)



I've tried many different things, but I can't seem to get it right.



Example:



I enter 200. The converter converts it to 2 x 10^2


More From » html

 Answers
140

You can do something like this:



a = 200
a.toExponential(); //output 2e+2


fiddle:
http://jsfiddle.net/Q8avJ/9/


[#84771] Tuesday, June 19, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
frederickmohamedw questions
Wed, Sep 23, 20, 00:00, 4 Years ago
Sat, Jul 18, 20, 00:00, 4 Years ago
Sun, Apr 26, 20, 00:00, 4 Years ago
Sat, Jan 11, 20, 00:00, 4 Years ago
Fri, Dec 27, 19, 00:00, 4 Years ago
;