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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 838 views
  • 0 likes
  • 3 in conversation