Re: How to change float to char



Flavio Alberto Lopes Soares wrote:
> 
> I need to print float numbers in a gtk label and this widget only accept
> gchar in your text parameter, I want to know if exists some type of
> routine that changes float number in format a.bcde to char format
> "a.bcde".
> 

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

Of course, you may wish to modify the format string
for precision, etc.

Cheers,

Ralph Walden

-- 

Ralph E. Walden
Tripos, Inc.
rwalden tripos com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]