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

Home » Public Forums » archive » floats from strings... duh!
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: Floats [message #47861 is a reply to message #4362] Wed, 08 March 2006 13:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sheldon writes:

> Here is a silly question: Can I define a float array and control how
> many decimal places are kept? For example, I want all values to only
> have an accuracy to the nearest 100th (20.15 and not 20.154983445).
> Kind of like in printing, you know, the f5.2 print definition, but only
> for variables and arrrays.

I think you should get one of those Macintosh computers.
I hear they are really friendly. They can probably do
this. The rest of them...they are about as intelligent
as a piece of silicon! :-)

How about something like this:

array = RandomU(-3L, 4, 5)
print, array

array = Fix(array*100) / 100.
print, array

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: matching 2 grids
Next Topic: Solaris 10

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

Current Time: Fri Oct 10 09:32:54 PDT 2025

Total time taken to generate the page: 0.71914 seconds