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

Home » Public Forums » archive » Re: round to x number of decimals within floating point value?
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: round to x number of decimals within floating point value? [message #74352 is a reply to message #74335] Thu, 13 January 2011 11:40 Go to previous messageGo to previous message
Snow53 is currently offline  Snow53
Messages: 32
Registered: July 2010
Member
On Jan 13, 12:35 pm, David Fanning <n...@dfanning.com> wrote:
> Snow53 writes:
>> I need to round the values within a file to three decimal places. For
>> example, 0.00053335 would become 0.001.
>> I also have many NaNs within the file.
>
>     goodval = where(array EQ Finite(), count)
>     if count gt 0 then begin
>        array[gooval] = Float(Round(array[goodval]*1000)/1000.)
>     endif
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Sweet! Thanks :)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Temp variables are checked out
Next Topic: Re: Temp variables are checked out

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

Current Time: Sat Oct 11 03:52:34 PDT 2025

Total time taken to generate the page: 0.92557 seconds