Re: How to plot multiple charts and ho to round float to specific precision? [message #44958 is a reply to message #44858] |
Thu, 28 July 2005 17:52   |
Benjamin Hornberger
Messages: 258 Registered: March 2004
|
Senior Member |
|
|
Paul Van Delst wrote:
> Benjamin Hornberger wrote:
>
>>
>> Can't you just use a "0" in the format string ('(f0.2)') instead of
>> using a large number first and then trimming the string?
>
>
> I tried that first (based on your original post) but it didn't work for me.
>
> IDL> print, !version
> { x86 linux unix linux 6.0.3 Feb 26 2004 32 64}
> IDL> x=23.45654
> IDL> cx=string(x,format='(f0.2)')
> IDL> help, cx
> CX STRING = '23.456539'
> IDL> y=7140264.38264
> IDL> cy=string(y,format='(f0.2)')
> IDL> help, cy
> CY STRING = '7140264.500000'
>
> Dunno why not.
>
> paulv
>
IDL> print, !version
{ x86 Win32 Windows Microsoft Windows 6.1.1 Oct 11 2004 32 64}
IDL> x=23.45654
IDL> cx=string(x,format='(f0.2)')
IDL> help,cx
CX STRING = '23.46'
IDL> y=7140264.38264
IDL> cy=string(y,format='(f0.2)')
IDL> help,cy
CY STRING = '7140264.50'
Bug or feature?
Benjamin
|
|
|