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 


Text to Float

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
dyl10s
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 5

PostPosted: Mon Aug 22, 2016 4:44 pm    Post subject: Text to Float Reply with quote

I'm trying to pass text as a float(single) in VB.net. How does ce convert its text to a float value?
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Mon Aug 22, 2016 4:47 pm    Post subject: Reply with quote

There's a function called StrToFloat and anotherone called Val.
But I don't know if you can make use of that in VB too ...
Back to top
View user's profile Send private message
dyl10s
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 5

PostPosted: Mon Aug 22, 2016 4:48 pm    Post subject: Reply with quote

hhhuut wrote:
There's a function called
But I don't know if you can make use of that in VB too ...


This wont help me much but thanks for the attempt.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Mon Aug 22, 2016 5:58 pm    Post subject: Reply with quote

CE's Lua
Code:
local text = "3.5"
local value = tonumber(text)
print(value)

VB.NET
Code:
string text = "3.5";
float value = float.Parse(text);
Console.WriteLine("{0}", value);

Or was that C#... maybe
Code:
Dim text As String = "3.5"
Dim value As Single = Convert.ToSingle(text)
Console.WriteLine("{0}", value)
Back to top
View user's profile Send private message
dyl10s
How do I cheat?
Reputation: 0

Joined: 21 Aug 2016
Posts: 5

PostPosted: Tue Aug 23, 2016 8:43 am    Post subject: Reply with quote

I actually need to convert a string that is an actual word like "Score"
Back to top
View user's profile Send private message
unknown_k
Expert Cheater
Reputation: 5

Joined: 24 May 2011
Posts: 211

PostPosted: Tue Aug 23, 2016 8:47 am    Post subject: Reply with quote

dyl10s wrote:
I actually need to convert a string that is an actual word like "Score"

Are you kidding? Confused
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Aug 23, 2016 6:09 pm    Post subject: Reply with quote

Everyone knows "Score" translates to the float value 4.741567549E30.
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Wed Aug 24, 2016 2:10 am    Post subject: Reply with quote

But since "Score" has five characters and therefore is five bytes long, while a float only has four bytes, you're still missing one byte of information ...
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Aug 24, 2016 4:45 pm    Post subject: Reply with quote

It's called truncation. Get with the times!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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