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

Home » Public Forums » archive » Re: printing floats/integer
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: printing floats/integer [message #24110 is a reply to message #24108] Thu, 08 March 2001 09:01 Go to previous messageGo to previous message
Christopher W. O'Dell is currently offline  Christopher W. O'Dell
Messages: 20
Registered: February 2001
Junior Member
This problem has been around about as long as computers I think. I used
to have an old pascal routine that would tell you what format code you
needed for a given number, assuming you wanted to see the whole number,
but not anymore more than is necessary (for instance, 8.6). Has anyone
written such a function for IDL?

You could probably piece together what you need using this function I just
found on the IDL Libraries Browser at Washington (see below).

Good luck,
Chris
;----------------------------------------------------------- -------
function sigfig, range
;
;+
; NAME:
; SIGFIG
;
; PURPOSE:
; This function will return the number of significant figures in
; the value "range"
;
; CATEGORY:
; utilities
;
; CALLING SEQUENCE:
; result = sigfig(range)

; INPUTS:
; range = range for the significance, may be an array.
;
; OUTPUTS:
; result = the number of significant figures expressed in base 10,
; Example: sigfig(1000) = 3,
; sigfig(0.01) = -2
;
; COMMON BLOCKS:
; none.
; SIDE EFFECTS:
; none.
; MODIFICATION HISTORY:
; Written by: Trevor Harris, Physics Dept., University of Adelaide,
; July, 1990.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: contour labels question
Next Topic: Color 'n linestyle picker for Plot

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

Current Time: Wed Oct 08 14:58:19 PDT 2025

Total time taken to generate the page: 0.00404 seconds