BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

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;

 

 

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

What have you tried? Did you see the multiplier option?

yabwon
Amethyst | Level 16

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



ballardw
Super User

@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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1070 views
  • 1 like
  • 4 in conversation