-
May 24th, 2001, 10:49 AM
#1
Conversion from float to CString
Does anyone know a good conversion from float to CString, or from float to char?
-
May 24th, 2001, 10:56 AM
#2
Re: Conversion from float to CString
float x = 1.23f;
CString str;
str.Format("%f",x);
-
May 24th, 2001, 10:57 AM
#3
Re: Conversion from float to CString
float num = 3.5;
char c = 'e';
CString string;
string.Format ("%f", num);
string.Format ("%c", c);
I am Miss Maiden... Miss Iron Maiden :-D
-
May 24th, 2001, 10:59 AM
#4
Re: Conversion from float to CString
Use .Format for CString or sprintf for char pointer.
ex:
CString csStr;
csStr.Format("%f", 3.14)
// ...
char *lpszStr = (char*)malloc(sizeof(char) * 4);
sprintf(lpszStr, "%f", 3.14);
-
May 24th, 2001, 11:03 AM
#5
Re: Conversion from float to CString
float float = 1.0003;
CString temp;
tmp.Format ("%f", float);
Rate this post if helped.
and Canada rocks!! Peace bro.
-
May 24th, 2001, 11:18 AM
#6
Re: Conversion from float to CString
Thanks, that was very useful
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|