View previous topic :: View next topic |
Author |
Message |
Stephen Yang Newbie cheater Reputation: 0
Joined: 22 Feb 2015 Posts: 14
|
Posted: Wed Mar 18, 2015 1:05 pm Post subject: How can I change the address value display in the CEedit? |
|
|
I used CEedit1.text = readFloat(address),and the text show the value such as 0.47.
Is it possible to convert the value display type into value like 47?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Wed Mar 18, 2015 1:12 pm Post subject: |
|
|
string.format("%f",readFloat(address)*100)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Stephen Yang Newbie cheater Reputation: 0
Joined: 22 Feb 2015 Posts: 14
|
Posted: Wed Mar 18, 2015 1:30 pm Post subject: |
|
|
Dark Byte wrote: | string.format("%f",readFloat(address)*100) |
Thx for reply, Dark Byte,but I still have some quests.
How to display the string value in the text?
Like this? CEedit.text = string.format("%f",readFloat(address)*100)
And the number 100 is fixed or I can change it if I need?
|
|
Back to top |
|
|
hhhuut Grandmaster Cheater Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Wed Mar 18, 2015 2:25 pm Post subject: |
|
|
if you want to make 47 from 0.47 you need to multiply it with 100, that's what the number's doing there. Of course you can change that freely ...
|
|
Back to top |
|
|
Stephen Yang Newbie cheater Reputation: 0
Joined: 22 Feb 2015 Posts: 14
|
Posted: Wed Mar 18, 2015 10:26 pm Post subject: |
|
|
hhhuut wrote: | if you want to make 47 from 0.47 you need to multiply it with 100, that's what the number's doing there. Of course you can change that freely ... |
Thx a lot.
If I wish to make my own string what should I do?
for example I'd like to do this:
(a/3)+25
and I also want to know what does %f mean?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Mar 18, 2015 10:34 pm Post subject: |
|
|
http://www.cplusplus.com/reference/cstdio/printf/
Not entirely sure what you mean by wanting to create that string. Just put quotes around it?
Unless you wanted:
Code: | value = readFloat(address)
value = value * 100
total = value / 3 + 25
result = string.format("(%0.2f/3)+25=%0.2f", value, total) |
|
|
Back to top |
|
|
Stephen Yang Newbie cheater Reputation: 0
Joined: 22 Feb 2015 Posts: 14
|
Posted: Wed Mar 18, 2015 10:38 pm Post subject: |
|
|
Zanzer wrote: |
Not entirely sure what you mean by wanting to create that string. Just put quotes around it?
Unless you wanted:
Code: | value = readFloat(address)
value = value * 100
total = value / 3 + 25
result = string.format("(%0.2f/3)+25=%0.2f", value, total) |
|
Thank you,that's what I want, can you tell what does 0.2f mean?
and how I can place the result into CEedit.text?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Mar 18, 2015 10:43 pm Post subject: |
|
|
Read the URL I posted for all the possible format specifiers.
f means the value will be a float, 0.2 means to display 2 digits after the decimal.
Code: | CEedit.text = result |
|
|
Back to top |
|
|
Stephen Yang Newbie cheater Reputation: 0
Joined: 22 Feb 2015 Posts: 14
|
Posted: Wed Mar 18, 2015 10:46 pm Post subject: |
|
|
Zanzer wrote: | Read the URL I posted for all the possible format specifiers.
f means the value will be a float, 0.2 means to display 2 digits after the decimal.
Code: | CEedit.text = result |
|
Thank you very very very much.
|
|
Back to top |
|
|
|