Is there a format that will make sure that all output has the same number of digits to the right of the decimal point regardless of whether the value is less than 1%? t seems to me that there should be something like a PERCENTZ.d format that will output a 0 to the left of the decimal point when appropriate. Is there such a format?
Example: a column of values output using the PERCENT7.3 format:
7.44%
3.36%
.242%
What I want:
7.44%
3.36%
0.24%
PERCENT7.2 ought to give you the desired results
Thanks. I feel silly because I forgot the difference between PERCENTw.d and PERCENTNw.d. (The difference is in how negative percentages are output. PERCENTw.d outputs them in parentheses requiring accounting for 2 additional characters in the output.)
PERCENTN7.2 will also work -- when I know that all of my percentages will be between 99.99% and -99.99%.
For a summary of the PERCENTw.d and PERCENTNw.d formats and a discussion of field widths, see "Those tricky PERCENT formats."
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.