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

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

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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