Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!cernvax!chx400!ugun2b!ugun2a!pfennige From: pfennige@uni2a.unige.ch Newsgroups: comp.lang.fortran Subject: Re: FLOAT <-> CHARACTER Message-ID: <565@uni2a.unige.ch> Date: 15 Jun 90 08:54:48 GMT References: Organization: University of Geneva, Switzerland Lines: 27 In article , jy0q+@andrew.cmu.edu (Jules Andrew Yasuna) writes: > Does anyone have access to subroutines/functions which will > convert floating point variables to and from character variables. > The essence of such a code is not all too involved { INDEX(), CHAR(), > ICHAR(), etc. along with some knowledege os ASCII codes } yet > implementation, namely bookeeping, tends to be quite tedious. > > If anyone has developed such routines (personal or Public Domain) and > is willing to share them, I would be most grateful !! > These possibilities are included in Fortran: ------------ character*15 cnumber real x ... c conversion real -> character x = 1.23456 write(cnumber,*) x ... c conversion character -> real cnumber = '9.87654' read (cnumber,*) x ... ------------- The * can be replaced by any FORMAT of course. Dan