Hi Member,
How to display decimal values and integer values in the same column? For example, I want my column looks like:
Column
1.62
2
3
1.59
.
.
.
Now the result I got is:
Column
1.20
2.00
3.00
1.17
Here is the program:
data test;
input A B;
C = round(A/B, .01);
cards;
6 5
8 4
9 3
7 6
;
run;
proc print data = test; run;
Is there a way that I don't need to show decimals when the number is integer (like 2), and keep the decimals when it is not integer (like 1.20).
Thank you for your help.
Have you taken a look at formats like BESTDw.p?
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003171706.htm
Hi Fugue,
I got what I want. Thank you!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.