delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/01/23:30:21

Date: Mon, 1 Dec 1997 23:27:04 +0500 (GMT)
From: Guillermo Porras <guporras AT calvin DOT univalle DOT edu DOT co>
To: Jamie Love <jamie DOT love AT clear DOT net DOT nz>
cc: DJGPP mailing list <djgpp AT delorie DOT com>
Subject: Re: converting floats to strings
In-Reply-To: <199712020026.NAA17553@fep1-orange.clear.net.nz>
Message-ID: <Pine.GSO.3.96.971201232123.20591A-100000@calvin.univalle.edu.co>
MIME-Version: 1.0

On Wed, 3 Dec 1997, Jamie Love wrote:

> hi, my problem is summed up in the subject. Is there a function that can
> convert float variables to strings?

 float float_number ;
 char *string ;

/*I use */  sprintf ( string ,"%f", float_number ) ;

 I recomend using a decimal precision- Exmpl: %.3f  (for 3 decimal
 precision ).


> 
> Jamie Love


> now on the web at http://www.geocities.com/SiliconValley/Horizon/4532
> e-mail me at jamie DOT love AT clear DOT net DOT nz
> 

- Raw text -


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