Raised This Month: $32 Target: $400
 8% 

Solved I need help for float


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Swolly
Senior Member
Join Date: Jul 2018
Location: Turkey
Old 01-24-2019 , 09:42   I need help for float
Reply With Quote #1

I need help for float.

I make vote plugin but trying to get a rate float is getting 0

I want get vote win rate

Code:
		int votes, totalVotes;
		GetMenuVoteInfo(param2, votes, totalVotes);
		float Rate = votes / totalVotes * 100.0;

Last edited by Swolly; 01-24-2019 at 10:26.
Swolly is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 01-24-2019 , 10:01   Re: I need help for float
Reply With Quote #2

float Rate = float(votes) / float(totalVotes*100);
__________________
My Steam I take private requests if related with TF2
My Plugins
Facksy is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-24-2019 , 10:06   Re: I need help for float
Reply With Quote #3

Nvm about my request, Facksy is correct here =P
adma is offline
Swolly
Senior Member
Join Date: Jul 2018
Location: Turkey
Old 01-24-2019 , 10:08   Re: I need help for float
Reply With Quote #4

Quote:
Originally Posted by Facksy View Post
float Rate = float(votes) / float(totalVotes*100);
Rate:
0.004999

Solved

Last edited by Swolly; 01-24-2019 at 10:26.
Swolly is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-27-2019 , 00:29   Re: I need help for float
Reply With Quote #5

Quote:
Originally Posted by Swolly View Post
Rate:
0.004999

Solved
No no no the 100 needs to be removed from the quotes you need at least 20000 players to produce this little percents.

(float(votes) / float(totalVotes)) * 100.0
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 01-27-2019 at 00:31. Reason: Fixed amount of players needed to produce 0.005 percents of votes.
eyal282 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode