comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » formatting exponential notation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
formatting exponential notation [message #47961] Fri, 10 March 2006 05:33 Go to next message
Steve.Morris@libero.i is currently offline  Steve.Morris@libero.i
Messages: 12
Registered: March 2006
Junior Member
Hi all,

I need a quick advice on the way to write number in the exponent format
I want.
For example, I want the number printed on my screen in the following
form
-2.3435e-5

i.e. 4 digits after the point and as function of e-5

Any suggestion? I have tryed to use the format='(EX.X)' but without
much of a success .... :(
Re: formatting exponential notation [message #48007 is a reply to message #47961] Sat, 25 March 2006 05:37 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Steve.Morris@libero.it writes:

> I think there's a bug somewhere, but didn't get time to go through. For
> example 0.99 when approximated with 1 decimal digit is written 0.1
> rather than 1.0

I think this is fixed now.

http://www.dfanning.com/number_formatter.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: formatting exponential notation [message #48036 is a reply to message #47961] Wed, 22 March 2006 18:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Steve.Morris@libero.it writes:

> I think there's a bug somewhere, but didn't get time to go through. For
> example 0.99 when approximated with 1 decimal digit is written 0.1
> rather than 1.0

Humm, indeed. But the bug didn't yield in the 20 minutes
I was able to devote to the problem. I'll have to get to
it later this week.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: formatting exponential notation [message #48046 is a reply to message #47961] Wed, 22 March 2006 06:35 Go to previous message
Steve.Morris@libero.i is currently offline  Steve.Morris@libero.i
Messages: 12
Registered: March 2006
Junior Member
I multyply the number by 1e5 and write with 4 decimal digits and works
like a charm :))))

I think there's a bug somewhere, but didn't get time to go through. For
example 0.99 when approximated with 1 decimal digit is written 0.1
rather than 1.0
Re: formatting exponential notation [message #48076 is a reply to message #47961] Mon, 20 March 2006 12:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Steve.Morris@libero.it writes:

> it looks like work very nicely in trimming the decimals, but can you
> also set the exponent format?
> Like, asking to have all numbers with e.g. 4 decimals and writted as
> function of e-5 ?
> so, if you have like 24.53214e-6 writte 2.4532e-5

You can do whatever you like. The code is available. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Installing 6.2 on Fedora Core 5
Next Topic: Re: Envi Routines

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:06:08 PDT 2025

Total time taken to generate the page: 0.00663 seconds