Float to Integer
#1

How can I convert a Float into an integer ?
Reply
#2

pawn Код:
new YourInteger = floatround(/*YourFloat*/, floatround_round);
EXAMPLE:

pawn Код:
CMD:float(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    new ix = floatround(x, floatround_round);
    new string[128];
    format(string,128, "%d", ix);
    print(string);
    return 1;
}
Search next time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)