Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Okay it's 4AM so my brain is nowhere to be found. I have 2 variables; total_wins and my_wins. I want it to display to the player what percentage of wins are theirs. What maths do I need for this?
Posts: 631
Threads: 58
Joined: Jun 2010
Reputation:
0
(my_wins / total_wins) = percentage
Posts: 601
Threads: 74
Joined: Sep 2009
Reputation:
0
(my_wins / total_wins)*100 = percentage
that will get you a percentage.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
When I do
(my_wins/total_wins)*100
it returns as 0...
Posts: 3,793
Threads: 196
Joined: Jan 2010
Reputation:
0
Are the variable stored correctly/used correctly?
Posts: 631
Threads: 58
Joined: Jun 2010
Reputation:
0
Try doing
(my_wins/total_wins*100) you may be getting errors having the *100 outside of the parenthesis, and also check what Lorenc_ said most likely it is the variables not being stored right.
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
I changed them to floats and it worked >.>