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

Home » Public Forums » archive » number of decimals?
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: number of decimals? [message #41998 is a reply to message #41751] Thu, 09 December 2004 00:56 Go to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <1102567764.693437.32940@c13g2000cwb.googlegroups.com>,
"Unknown" <ytyourclothes@p.zapto.org> wrote:

> ...
> IDL> printf,unit,f,format='(10f9.2)'
> but that'll introduce additional spaces wherever a number is smaller
> than 10000. So a typical line might look like this: 123.45 678.23
> 1.23 12345.67 ... etc
> But what I want is
> 123.45 678.23 1.23 12345.67 ...
> What I'm trying to do would be written in C somewhat like this: "%.2f
> %.2f %.2f", i.e. a floating point number with two decimals.
> ...
> Y. T.

No tricks, but you can use the C format codes in IDL

f=randomn(seed, 10,10)
print, format='(10(%"%0.5f "))',f[0,*]

That will write out floating point numbers with 5 decimal places and a
single space between each number. Your emacs loving
friends will disown you for breaking their copy-rectangle-to-register,
but I think it's what you want.

Chris.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: READ_ASCII - accessing data from structures
Next Topic: To PVM or not to PVM

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

Current Time: Sat Oct 11 08:57:12 PDT 2025

Total time taken to generate the page: 0.16112 seconds