Scientific Notation in App Lab

I’m teaching a semester course using some of the CS Discoveries material and began to think about how I introduce this interface with its possibility of building a phone app into my other classes.

The natural fit is parts of an intro chemistry course I teach. There are several times during the year when students have to complete repetitive calculations (perfect coding opportunity). Unfortunately, the first one involves the use of scientific notation, e.g. 3.0 x 10^8 m/s for the speed of light in a vacuum. App lab understands 3.0E8 as the number I mention above, but to be really useful, my students would need to force calculated numbers into scientific notation. “E” format (3.0E8) would be fine.

I’d appreciate any help.

Did you try using the toExponential Function? For example:

var num = 5.56789;
setText(“text_input1”, num.toExponential());

That’s the ticket. Thanks so much!!!