26.07.2012, 05:34
(
Последний раз редактировалось Sniper Kitty; 26.07.2012 в 07:01.
)
DELETED:
Edit: Being more specific.
Okay let's say X is 1499.890984, Y is 38.796445, and Z is not used.
I don't want the last 4 digits, I just want X to be 1499.89 and Y to be 38.79.
Basically rounding to the hundredth place in a decimal (float).
How do I do that?
Edit2: Solved.
Edit: Being more specific.
pawn Код:
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
I don't want the last 4 digits, I just want X to be 1499.89 and Y to be 38.79.
Basically rounding to the hundredth place in a decimal (float).
How do I do that?
Edit2: Solved.
pawn Код:
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
X = (floatround((X * 100)) / 100);
Y = (floatround((X * 100)) / 100);