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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.