Post Reply 
Convert number to scientific notation
03-08-2019, 04:57 PM
Post: #1
Convert number to scientific notation
Is there a CAS function or something similar to convert a given number to scientific notation?

Obs: I tried changing the number format to scientific but it only converts to X*E^Y if there is a decimal point in X, i.e., it converts 100.0 to 1.0e^2 but not 100, beside the fact that I only want to use this in some specific situations, so a CAS function would be the best solution.

I tried creating this CAS program using Python but (at least with the PC emulator) it crashes when I try to use the function.

Code:
#cas
def base10(x):
 return "{:.2e}".format(x)
#end
Find all posts by this user
Quote this message in a reply
03-08-2019, 05:57 PM
Post: #2
RE: Convert number to scientific notation
If you mean in a program, then the STRING function might suffice for you. WARNING: You must spell STRING in uppercase letters or it won't work as expected. For example:

STRING(10000,3,0) --> "1e4"

where the 3 argument means "Scientific Display Mode" and the 0 means "displaying zero digits after the decimal point". The built-in Help system contains more info (and lots more options) about the STRING function.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)