>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  NUMFRAC

NUMFRAC

NUMFRAC

Name


      NUMFRAC

Purpose


      Convert a number to a decimal string with n places.

Category


Calling Sequence


      ss = numfrac(val, n)

Inputs


      val = value to convert (may be an array). in
      n = number of decimal places (def=0). in

Keyword Parameters


Keywords


        DIGITS=nd Force number of digits to nd.
          Only for n=0, no decimal places.

Outputs


      ss = resulting string. out

Common Blocks


Notes


      Notes: Why is this routine needed? Try the following:
        print,string(230d0-5e-14,format='(I3)')
        Try it again without the format. The I format does
        not round, but the F format does. This routine
        uses that fact and makes it convenient to do.
        The result has no spaces on the ends so varying length
        values will not line up (except integers).

Modification History


      R. Sterner, 1998 May 22
      R. Sterner, 2010 Dec 20 --- Converted arrays from () to [].
  Copyright (C) 1998, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us