real to character converter

John H Merritt merritt at iris613.gsfc.nasa.gov
Tue Feb 27 07:15:22 AEST 1990


In article <9002261609.AA20841 at aero4.larc.nasa.gov> blbates at AERO4.LARC.NASA.GOV ("Brent L. Bates AAD/TAB MS294 x42854") writes:
>
>    I don't know of any way to do it in FORTRAN, however, I noticed
>some C routines that might do what you want: ecvt,fcvt,gcvt.  Check
>section 3 of your UNIX manuals.

Use an internal write!

		character *80 cnum
		x = 1.2345
		write(cnum,'(f10.3)') x

and for C use sprintf.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
John H. Merritt                   #  Yesterday I knew nothing,
Applied Research Corporation      #  Today I know that.
merritt at iris613.gsfc.nasa.gov     #



More information about the Comp.sys.sgi mailing list