Page 1 of 1
Convert scientific notation to decimal?
Posted: Fri Sep 29, 2017 4:37 am
by ClipArtGuy
I'm looking for a way to convert a number represented in scientific notation such as "9.0260588394524e-5 " to a more human readable decimal format. Is there a function for this in LC?
Re: Convert scientific notation to decimal?
Posted: Fri Sep 29, 2017 5:01 am
by dunbarx
It would be fun to write such a function, simple and straightforward, but do check out the "format" function in the dictionary. That gadget is an embarrassment of riches for just the sort of thing you asked for.
Craig Newman
Re: Convert scientific notation to decimal?
Posted: Fri Sep 29, 2017 8:03 am
by Thierry
ClipArtGuy wrote:I'm looking for a way to convert a number represented in scientific notation such as "9.0260588394524e-5 " to a more human readable decimal format. Is there a function for this in LC?
Hi ClipArtGuy,
check format() in the dictionary.
Code: Select all
put "9.0260588394524e-5" into X
put format( "%s to floating point: %.6f ", X, X )
Thierry
Re: Convert scientific notation to decimal?
Posted: Fri Sep 29, 2017 5:28 pm
by ClipArtGuy
Thanks Craig and Thierry! It looks like format() is exactly what I needed.