BookmarkSubscribeRSS Feed
fredbell
Fluorite | Level 6
Morning!

I have a number 41.2 and i want it to show as 41 removing everything after the decimal, can anyone help?

Thanks

Fred
5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12
If you want to actually remove the decimal part, then the function to use is FLOOR. If you just want to display it without a decimal, then just use a format, like
FORMAT myvar 3.;
fredbell
Fluorite | Level 6
Hi Duke

Sorry for my lack of knowledge, how can i incorporate the FLOOR into the below code?

Fred

proc sql;
create table TVStats as
select
mean(TvAverage_Speed_of_Answer__Sec_) as Tv_AvgSpeedofAnswerSec
FROM Cscore.tv;
quit;
OS2Rules
Obsidian | Level 7
Hi All:

Not to go off-topic, but I have a similar question. How do I get just the mantissa of the floating-point number - other than subtracting the figure from its' integer? I could have sworn that there was a function (like the opposite of int() ) that would do it.
Doc_Duke
Rhodochrosite | Level 12
FredBell: Just add the floor to the Mean line
FLOOR(mean(TvAverage_Speed_of_Answer__Sec_)) as Tv_AvgSpeedofAnswerSec

OS2 Rules: please start a new thread.
fredbell
Fluorite | Level 6
Thanks for your help Duke.

Fred

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1078 views
  • 0 likes
  • 3 in conversation