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

Home » Public Forums » archive » Converting Doubles to Strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Converting Doubles to Strings [message #46172] Fri, 04 November 2005 23:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I've run into an interesting problem. I have a double precision
number that I wish to convert to a string (so I can put it into
a text widget, for example). I don't know ahead of time how many
significant digits will be in this number. The number could
look like this 45.6, or this 123456789.123456789, or this
-22.1234567890. If it looks like the latter number, I am
having a very hard time converting it to a string. For example,
this doesn't work:

IDL> v = String(-22.1234567890, Format='(D0)')
IDL> Print, v
-22.123457

Is this a bug in IDL? Or am I overlooking something?

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: Specifying Log Axis Tick Marks
Next Topic: Re: Save 2D conversion matrix

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

Current Time: Fri Oct 10 15:25:16 PDT 2025

Total time taken to generate the page: 2.31892 seconds