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

Home » Public Forums » archive » Re: Rounding off
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: Rounding off [message #70591 is a reply to message #70590] Thu, 22 April 2010 09:37 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
bala murugan wrote:
> Suppose i have the following,
>
> r = RANDOMU(SEED,1)
>
> and if the result is 0.423832.
>
>
> How do i round it off to 0.42 ??

IDL> r = RANDOMU(SEED,1)
IDL> print, r
0.447645
IDL> print, r, format='(f4.2)'
0.45

I presume you meant "only print two digits after the decimal point" when you said "round
it off".

?

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: isurface madness?
Next Topic: baffling syntax error

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

Current Time: Sun Nov 30 00:02:19 PST 2025

Total time taken to generate the page: 0.08657 seconds