31.05.2014, 08:44
I have value : 52.42
How to extract it to 2 Integer?
Like that:
new value[2];
value[0] = 52;
value[1] = 42;
How to extract it to 2 Integer?
Like that:
new value[2];
value[0] = 52;
value[1] = 42;
new Float: fNumber = 52.42;
value[0] = floatround(fNumber, floatround_ceil);
You can use floatround to round up a float in to an integer.
pawn Код:
|
new Float:value = 52.42; new int_value = floatround(value); |
stock GivePlayerCash(playerid, dollar, cent=0) { new dollars, mtotal; dollars = dollar*100; mtotal = dollars+cent; SetPVarInt(playerid, "Cash", GetPVarInt(playerid, "Cash")+mtotal); GivePlayerMoney(playerid, mtotal); return 1; }
floatfract is what you need.
|