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

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

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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%

View solution in original post

6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20

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;
mariopellegrini
Pyrite | Level 9

I am interested in the format, not informat. I would visualize on the table 12,5% with comma

PeterClemmensen
Tourmaline | Level 20

That's exactly what my code does?

mariopellegrini
Pyrite | Level 9

@PeterClemmensen thank you. It's correct. How do I increase a decimal? 

FreelanceReinh
Jade | Level 19

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%
Ksharp
Super User
proc format;
   picture PercentC low-high = '009,999%' (decsep=',' multiplier = 100000);
run;

data _null_;
   a = 0.125;
   put a = PercentC.;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2413 views
  • 1 like
  • 4 in conversation