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

I'm having trouble finding out which format will get the results I am looking for.

 

I'd like to convert a number like this 0.032258 to 3.2

1 ACCEPTED SOLUTION

Accepted Solutions
ghosh
Barite | Level 11

Create a format to simulate percent if you don't want the % sign

percent.png
proc format; picture perc (round) low - high ='009.9' (mult=1000); run; data x; input a; cards; 0.032258 0.12345 1.2345 ; proc print; format a perc.; run;

View solution in original post

4 REPLIES 4
novinosrin
Tourmaline | Level 20

Hi @nbwest76  are you asking percent format?

0.032258 is 3.2 %

 

Reeza
Super User
Multiply by 100 and format? Or apply a percentage format to your variable?

want = x * 100;
format want 8.1;
format x percent12.1;
ChrisNZ
Tourmaline | Level 20

You can also use the multiplier option in a picture format.

ghosh
Barite | Level 11

Create a format to simulate percent if you don't want the % sign

percent.png
proc format; picture perc (round) low - high ='009.9' (mult=1000); run; data x; input a; cards; 0.032258 0.12345 1.2345 ; proc print; format a perc.; run;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 461 views
  • 1 like
  • 5 in conversation