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

AI Navigator GIF.gif


Navigate AI governance with SAS tools for compliance and ethical AI practices. Try SAS Ai Navigator for free for the first six months.

Check it out on Microsoft Marketplace →

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
  • 1237 views
  • 0 likes
  • 2 in conversation