Complete.Org: Mailing Lists: Archives: discussion: March 2001:
[aclug-L] Re: c problems float to string
Home

[aclug-L] Re: c problems float to string

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: discussion@xxxxxxxxx
Subject: [aclug-L] Re: c problems float to string
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: 23 Mar 2001 16:06:57 -0500
Reply-to: discussion@xxxxxxxxx

You might try:

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

beware the follies of not using snprintf() though!

-- John

oceano <nathan@xxxxxxxxxxxxxxxx> writes:

> I'm designing a GUI using GTK+ and C via gcc.  I have hit a snag in not
> being able to convert a float value to a character string.  There are
> simple functions to go from string or character to float which I use but
> not the other way around? Can anyone help or will I have to suffer?
> 
> I would like to convert say, 123.0 to a string "123.0".
> 
> 
> -- This is the discussion@xxxxxxxxx list.  To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
> 
> 

-- 
John Goerzen <jgoerzen@xxxxxxxxxxxx>                       www.complete.org
Sr. Software Developer, Progeny Linux Systems, Inc.    www.progenylinux.com
#include <std_disclaimer.h>                     <jgoerzen@xxxxxxxxxxxxxxxx>

-- This is the discussion@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]