Hi,
I'm trying to convert numbers such as 32.5 to 32,5% using a format.
Below is the link to the format which adds the % symbol but I can't seem to find one which converts it to European decimal convention as well.
https://support.sas.com/kb/38/001.html
Thanks,
Mladen
I don't think such a format exists. though you can roll out your own doing something like this
proc format;
picture fmt other = '09,9%' (mult=10);
run;
data test;
a = 32.5;
format a fmt.;
run;
I don't think such a format exists. though you can roll out your own doing something like this
proc format;
picture fmt other = '09,9%' (mult=10);
run;
data test;
a = 32.5;
format a fmt.;
run;
Thanks that's exactly what I was looking for.
Draycut,
What if there are two or more digit after decimal ?
proc format;
picture fmt other = '09,99%' (decsep=',');
run;
data test;
a = 32.5;output;
a = 32.55;output;
format a fmt.;
run;
This worked great for me also. Is it possible to combine decsep and mult, to convert 0.325 to 32,5%. The code below did not work.
proc format;
picture fmt other = '09,99%' (decsep=',' mult=100);
run;
However I did get it working using the method from the answer, I just wanted to know why mult and decsep did not work together.
proc format;
picture fmt other = '009,99%' (mult=10000);
run;
You want this ?
proc format; picture fmt other = '09,99%' (decsep=',' multi=10000 ); run; data test; a = .325;output; a = .326;output; format a fmt.; run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.