delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/03/11/09:15:15

From: richardson AT evansville DOT edu (Tony Richardson)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Float to string
Date: 11 Mar 2003 06:04:57 -0800
Organization: http://groups.google.com/
Lines: 11
Message-ID: <2f64dfca.0303110604.529642ca@posting.google.com>
References: <18602N500 AT web2news DOT com>
NNTP-Posting-Host: 192.195.225.6
X-Trace: posting.google.com 1047391498 14776 127.0.0.1 (11 Mar 2003 14:04:58 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 11 Mar 2003 14:04:58 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Joel_S wrote:
> Ok, I think that the only standard number to string function is itoa,
> but does anybody have any code, or know of a library that contains a
> float to string routine?  Thanks.

sprintf(string,"%f",x);

There are a bunch of options that dictate the floating point format
see the sprintf man page for details.

Tony Richardson

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019