BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

data have;

num = 3298056;

pct = 46.51644;

avg = 1.2555

run;

 

What is the best way to format the numbers to capture proper commas and to capture the numbers up to 2 decimal places only

 

So num = 3,298,056   pct = 46.52  avg = 1.25

1 REPLY 1
PaigeMiller
Diamond | Level 26

You can use different formats for each variable. So for NUM, use the COMMA format, and for PCT and AVG, you can use best10.2 (or similar, there are many choices that will work)

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 785 views
  • 0 likes
  • 2 in conversation