Rounding numbers?
#3

Код:
dcmd_stats(playerid, params[])
{
	#pragma unused params
    new msg[128];
    
    new Float:kd = floatround(pInfo[playerid][kills] / pInfo[playerid][deaths]*100.0)/100.0;

	format(msg, sizeof(msg), "Kills: %i | Deaths: %i | Ratio: %f", pInfo[playerid][kills], pInfo[playerid][deaths], kd);

	SCM(playerid, COLOR_RED, "_________STATS_________");
	SCM(playerid, COLOR_RED, msg);
	return 1;
}
When kills is 635 and deaths is 86 it says this:
Код:
Kills: 635 | Deaths: 86 | Ratio: 7.000000
Any ideas?
Reply


Messages In This Thread
Rounding numbers? - by sciman001 - 09.12.2011, 18:44
Re: Rounding numbers? - by MadeMan - 09.12.2011, 18:52
Re: Rounding numbers? - by sciman001 - 09.12.2011, 18:56
Re: Rounding numbers? - by MadeMan - 09.12.2011, 19:05
Re: Rounding numbers? - by sciman001 - 09.12.2011, 19:07
Re: Rounding numbers? - by sciman001 - 09.12.2011, 19:18
Re: Rounding numbers? - by Wesley221 - 09.12.2011, 19:18
Re: Rounding numbers? - by sciman001 - 09.12.2011, 19:20
Re: Rounding numbers? - by sciman001 - 09.12.2011, 19:25
Re: Rounding numbers? - by MadeMan - 09.12.2011, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)