Help With Getting Percentage
#6

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
....
Float:GetPercentageOfMoney(playerid, Floatercents)
{
return floatdiv(floatmul(GetPlayerMoney(playerid), percents), 100);
}
As a side note, this is really slow as compared to this -

pawn Код:
new money = 5000,
       Float: percentMoney = (money * 0.65); // 65 percent of money
float*** functions are quite slow, I see no need to use them..

EDIT: In response to your below post -

pawn Код:
main() {
   
    new money = 5000;
    new Float: percentMoney = (money * 0.50);
   
    printf("%0.2f", percentMoney);
   
}
works quite perfectly.
Reply


Messages In This Thread
Help With Getting Percentage - by AroseKhanNiazi - 23.05.2014, 10:59
Re : Help With Getting Percentage - by S4t3K - 23.05.2014, 11:05
Re: Help With Getting Percentage - by AroseKhanNiazi - 23.05.2014, 11:08
Re : Help With Getting Percentage - by S4t3K - 23.05.2014, 11:10
Re: Help With Getting Percentage - by AroseKhanNiazi - 23.05.2014, 11:12
Re: Re : Help With Getting Percentage - by RajatPawar - 23.05.2014, 12:04
Re : Help With Getting Percentage - by S4t3K - 23.05.2014, 12:06
Re: Help With Getting Percentage - by AroseKhanNiazi - 23.05.2014, 12:28
Re : Help With Getting Percentage - by S4t3K - 23.05.2014, 12:49
Re : Help With Getting Percentage - by S4t3K - 23.05.2014, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)