Percent calculation
#3

pawn Код:
Float:GetPercentage(Float:score, Float:minscore, Float:maxscore)
{
    return (((score - minscore) / (maxscore - minscore)) * 100.0);
}
Sample:
pawn Код:
printf("%0.0f%%", GetPercentage(20, 20, 25));

// Result: 0%
Reply


Messages In This Thread
Percent calculation - by ax1 - 21.08.2016, 20:16
Re: Percent calculation - by Shinja - 21.08.2016, 21:03
Re: Percent calculation - by Gammix - 21.08.2016, 21:44
Re: Percent calculation - by ax1 - 22.08.2016, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)