BookmarkSubscribeRSS Feed
Belle
Obsidian | Level 7

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.

2 REPLIES 2

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1049 views
  • 3 likes
  • 2 in conversation