Hello
I am using proc report to calculate sum of revenue and the numbers are in local currency (PLN).
I need to display the numbers in millions:
for example:
1,000,000 will be displayed as 2
161,391,185 will be displayed as 161.3(then I want to round it to 161)
35,257,624,389 will dispalyed as 35,257.6 (then I want to round it to 35,258)
what is the correct way to do it with picture format?
Data example;
input x;
cards;
1000000
161391185
35257624389
;
run;
What have you tried? Did you see the multiplier option?
As @ChrisNZ said, use the ROUND option:
proc format;
picture zlotowkiR (ROUND)
low - high = '000,000,000 mln PLN' (mult=0.000001)
;
picture zlotowki
low - high = '000,000,000.0 mln PLN' (mult=0.00001)
;
run;
Data example;
format x best. y zlotowki. z zlotowkiR. ;
input x;
y = x;
z = x;
cards;
1000000
161391185
35257624389
;
run;
proc print;
run;
pozdrowienia
Bart
@Ronein wrote:
Hello
I am using proc report to calculate sum of revenue and the numbers are in local currency (PLN).
I need to display the numbers in millions:
for example:
1,000,000 will be displayed as 2
161,391,185 will be displayed as 161.3(then I want to round it to 161)
35,257,624,389 will dispalyed as 35,257.6 (then I want to round it to 35,258)
what is the correct way to do it with picture format?
Data example;
input x;
cards;
1000000
161391185
35257624389
;
run;
Which is it? The subject line of your post says "Re: Display 1 million as 1". Your data above says "1,000,000 will be displayed as 2".
Do you have any values less than 1,000,000? If so you need to specify how you expect those to appear as well as a number of possible solutions that work for your shown values may well result in those other values not appearing as desired.
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.