BookmarkSubscribeRSS Feed
Smitha9
Fluorite | Level 6

Hi,

I have a dataset:

a 243.199965

b 345

c 123

 

I want the decimal only 2:

a 243.19

b 345.00

c 123.56

 

can anyone help me in this. thanks in advance

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:
There is a difference between the internally stored number and displaying a number on a report. You don't explain whether this is for a report or whether you want to change the number of decimal places in the stored data. Consider this:

Cynthia_sas_0-1629838784445.png

 



You can use the round function to change the internally stored value for a variable (as I do with the creation of the NEWVAR variable). But if you only care about the display for reporting, then you might want to allow the number to have full decimal places when stored.

Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1185 views
  • 2 likes
  • 3 in conversation