---> Need help with Float.
#2

What what I understand there might be a better way to do this but if you trying to save to a file do this.

new line[128];
format(line, sizeof(line), "%0.2f %0.2f %0.2f %0.2f", float1, float2, float3, float4);

That will round out to 2 decimal places.

Now if your not saving and want to round it try this

new roundvalue[32];

format(roundvalue, sizeof(roundvalue), "0.2f", floatvalue);
floatvalue = floatstr(roundvalue);

Mind you floats are not accurate so it probably won't round as expected.
Reply


Messages In This Thread
---> Need help with Float. - by sKgaL - 29.05.2013, 15:42
Re: ---> Need help with Float. - by Pottus - 29.05.2013, 16:07
Re: ---> Need help with Float. - by sKgaL - 29.05.2013, 16:16

Forum Jump:


Users browsing this thread: 1 Guest(s)