10-12-2016 03:09 PM
suppose I have the following table PARMS:
using the round function I rounded each value to 3 decimal places and got the following table PARMS2:
data parms2; set parms; estimate= round(estimate,.001); run;
Now I want to get rid of the extra zeroes - I want to leave only the integer part and the first 3 decimals. I thought just getting rid of the 2 right-most numbers using the following code:
But the result PARMS3 is a mess:
Could you please help me?
10-12-2016 03:21 PM
Note that using a format like 12.3 can remove the need for a separate rounding step and may prevent some odd behaviors involving multiple rounding.
data _null_; x= 123.78445; r1=round(x,0.0001); r2 = round(r1,0.001); r3 = round(r2,0.01); put x= 12.4 r1= x=12.3 r2= x=12.2 r3=; run;
Need further help from the community? Please ask a new question.