[LON-CAPA-users] display number with "E" scientific notation

Moore, Nathan T nmoore at winona.edu
Wed Sep 28 16:07:37 EDT 2022


Imagine I have a variable that's random

$length=&random(150,250,1);

Specific case, $length = 157;

I want this value to be printed for users with the "E" power of 10 notation, eg I want the user to see

1.57E2

The following code displays almost what I want, 1.57x10^2, but what I really want is 1.57E2 <num  format="%.02E">$length</num>

Thoughts on a workaround?

-----------------------------------------------------------------
Nathan Moore, PhD (he/him)

Professor, Physics and General Engineering Programs
Winona State University

Come study on Minnesota's Southeast Coast

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20220928/6a6f0c8a/attachment.html>


More information about the LON-CAPA-users mailing list