Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VC++] Convert a double to a string?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Dami
Master Cheater
Reputation: 0

Joined: 23 Oct 2006
Posts: 336

PostPosted: Wed Jun 03, 2009 3:08 pm    Post subject: [VC++] Convert a double to a string? Reply with quote

I want to change IDC_EDIT1, caption to a number of a double variable.
I used "_itoa" for normal integers, but how am i suppose to throw double value in it?

Example of what i was using
Code:
SetDlgItemText(hWnd, IDC_EDIT1, _itoa((Value), buf, 10));
Back to top
View user's profile Send private message
BirdsEye
Advanced Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 94

PostPosted: Wed Jun 03, 2009 3:24 pm    Post subject: Reply with quote

sprintf, swprintf (CRT) to write the data to the string or SetDlgItemInt
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Thu Jun 04, 2009 6:37 pm    Post subject: Reply with quote

lol, something tells me you're trying to set the EXP value!
Back to top
View user's profile Send private message Visit poster's website
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Jun 04, 2009 7:27 pm    Post subject: Reply with quote

colour0xFFA500 wrote:
lol, something tells me you're trying to set the EXP value!


Nuh Uh. Retrieving. Hes trying to convert # to $ so yea.
Back to top
View user's profile Send private message
talkerzero
Grandmaster Cheater
Reputation: 1

Joined: 24 Jul 2008
Posts: 560
Location: California

PostPosted: Thu Jun 04, 2009 9:48 pm    Post subject: Reply with quote

dnsi0 wrote:
colour0xFFA500 wrote:
lol, something tells me you're trying to set the EXP value!


Nuh Uh. Retrieving. Hes trying to convert # to $ so yea.

Ah, right. Smile

(edit) You could extract of the decimal places from the double, multiply it by (10 ^ number of decimal places), strcat() it to the whole number part of the decimal, then set that string with SetDlgItemText.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites