Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
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.
Posts: 61
Threads: 14
Joined: Mar 2013
Reputation:
0
Awsome,works great.
Thanks.