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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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