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

Home » Public Forums » archive » How to plot multiple charts and ho to round float to specific precision?
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: How to plot multiple charts and ho to round float to specific precision? [message #44974 is a reply to message #44858] Thu, 28 July 2005 05:14 Go to previous message
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
liko2@o2.pl wrote:
> No, this does only the rounding and output has still 4 digits after
> coma...I need to have only two digits after coma (eg. 23.46 not 23.4600)
>

It sounds like you don't want to *round* the number, but you want to
*print* it with a certain precision. Check the IDL help for "format
codes" and the FORMAT keyword to the STRING function and PRINT procedure.

IDL> print, 23.46, format='(f0.2)'
23.46

The "f" format code is for outputting floating point numbers. The "2"
means two digits after the decimal point. The "0" means "make the output
string just as long so that it fits".

Good luck,
Benjamin
[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
Previous Topic: Re: CALL_EXTERNAL and C++ code
Next Topic: Re: Multilayered plots

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

Current Time: Sat Oct 11 10:29:45 PDT 2025

Total time taken to generate the page: 0.86061 seconds