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

Home » Public Forums » archive » Re: IDL number output format problem?
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
Re: IDL number output format problem? [message #53856] Fri, 04 May 2007 13:11
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
lixiaoyao writes:

> I know it is a stupid question, but I just can not figure it out.
> Does anyone happen to know how to format one or a few of output
> numbers? Like I want one number has two number after the point, like
> 9.45 istead of 9.453678.
> Thanks in advance
> for i=0,n do printf, lun, F[i,0],F[i,1],(F[i,2],Format='(f9.2)'),F[i,
> 3],F[i,4],F[i,5],F[i,6],F[i,7],F[i,8],F[i,9],F[i,11],F[i,12]

It is probably not as stupid a question as you think it
is. In fact, for some numbers, it is quite difficult to
get formats like you want. You might have a look at the
NUMBER_FORMATTER program, described in this article:

http://www.dfanning.com/misc_tips/dbl_to_str.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL number output format problem?
Next Topic: MPEG to FITS CUBE

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

Current Time: Fri Oct 10 23:48:31 PDT 2025

Total time taken to generate the page: 0.31839 seconds