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

Home » Public Forums » archive » Re: Controlling number of decimal places
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: Controlling number of decimal places [message #40202] Tue, 27 July 2004 20:28 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Edwin writes:

> Say I have a DOUBLE variable that holds 200.23234 for example. I want
> to output this number to a text file as a number rounded to two
> decimal places. In other words, I want to output to a text file
> "200.23".
>
> How do I do this? I've looked into the ROUND function but only rounds
> to the nearest integer.

Something like this should work:

PrintF, lun, data, Format='(F8.2)'

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
Previous Topic: System Variables & .sav files
Next Topic: Import Arc Export File to IDLffShape

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

Current Time: Thu Oct 09 22:12:09 PDT 2025

Total time taken to generate the page: 0.08268 seconds