29.05.2013, 16:07
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.
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.