Good morning.
I would like to know if it is possible to display a percent format with a comma. Like this for example: 12,5% and not 12.5%
The percentw.d format always displays the period, not the comma.
Thank you
Hello @mariopellegrini,
You can also use the NLPCTw.d format:
options locale=IT_IT; /* This might be your default value. */
data _null_;
input p q;
put p nlpct6.1 q nlpct8.2;
cards;
0.125 -0.125
1 1.5678
;
Result:
12,5% -12,50% 100,0% 156,78%
I don't think it exists out-the-box. Though, you can always roll out your own like this
proc format;
picture PercentC low-high = '000.009,9%' (multiplier = 1000);
run;
data _null_;
a = 0.125;
put a = PercentC.;
run;
I am interested in the format, not informat. I would visualize on the table 12,5% with comma
That's exactly what my code does?
@PeterClemmensen thank you. It's correct. How do I increase a decimal?
Hello @mariopellegrini,
You can also use the NLPCTw.d format:
options locale=IT_IT; /* This might be your default value. */
data _null_;
input p q;
put p nlpct6.1 q nlpct8.2;
cards;
0.125 -0.125
1 1.5678
;
Result:
12,5% -12,50% 100,0% 156,78%
proc format; picture PercentC low-high = '009,999%' (decsep=',' multiplier = 100000); run; data _null_; a = 0.125; put a = PercentC.; run;
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.