DATA Step, Macro, Functions and more

How to manage decimal points?

Reply
Contributor
Posts: 61

How to manage decimal points?

Hi,

I have sas data file with more than 5 decimal points. I want to remove decimal with rounding off the last digit. How can I do?

Thanks

Super User
Posts: 3,102

Re: How to manage decimal points?

[ Edited ]
rounded = round(unrounded, 1); * Rounds to nearest whole number;
rounded4 = round(unrounded, 0.0001); * Rounds to 4 decimal places;
Contributor
Posts: 61

Re: How to manage decimal points?

Thanks SASKiwi!

 

my varaible to be rounded off is 'gesta_age_wks'. how should i write the code?

 

Best

Ask a Question
Discussion stats
  • 2 replies
  • 197 views
  • 0 likes
  • 2 in conversation