BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KyuL
Calcite | Level 5

Hi,

I need to format two variables, one is "Votes" in format: 1,360,235, Another is "Perc" in format: 47.28%.

I write Votes comma10. Perc percent10.

Is that correct?

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Be generous with the overall lengths of formats. You need to account for all possible digits, commas, and a sign.

PERCENT will display negative numbers in brackets, so you need to account for that.

The PERCENT format expects a ratio, so a value of 1 will display as 100%. Take that into consideration before applying the format.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

Be generous with the overall lengths of formats. You need to account for all possible digits, commas, and a sign.

PERCENT will display negative numbers in brackets, so you need to account for that.

The PERCENT format expects a ratio, so a value of 1 will display as 100%. Take that into consideration before applying the format.

KyuL
Calcite | Level 5

Thank you!

ballardw
Super User

The PERCENTNw.d format will use a negative sign instead of ( ) to indicate negative values, which means one fewer spaces to consider. Depends on which your intended readers would expect : (48.28%) or -48.28% in the body of the report.

 

 

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

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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