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

Home » Public Forums » archive » Re: formatting exponential notation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: formatting exponential notation [message #47958 is a reply to message #47957] Fri, 10 March 2006 07:04 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Kenneth P. Bowman wrote:
> In article <1141997588.908348.289430@j52g2000cwj.googlegroups.com>,
> "Steve.Morris@libero.it" <Steve.Morris@libero.it> wrote:
>
>
>> 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 .... :(
>
>
> I think one reason that the E format works the way it does:
>
> IDL> print, -2.3435E-5, format = "(E12.4)"
> -2.3435E-05
>
> is to ensure that the exponent part of the field is always 4 digits.
> That makes it easy to produce uniformly-aligned tables of numbers.
>
Additionally

print,strlowcase('-2.3435E-05')

-2.3435e-05

now you only have to strip the zero...

Ciao,
Paolo

> If you really want the result to appear like this
>
> -2.3435e-5
>
> you could always format it yourself (base-10 logarithms come to mind).
>
> Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I reduce active memory used by program?
Next Topic: Intel iMac IDL performance

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

Current Time: Sat Oct 11 15:10:05 PDT 2025

Total time taken to generate the page: 1.12177 seconds