By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

How can I get INTeger from float

P: n/a

Folks,

If I have a number that includes decimal points and I want to remove
everything right of the decimal, how do I do it - I know I could explode
using the point as a delimiter but that doesn't look legal.

I've tried

$t=1.532;
$y=int($t);
but that didn't work out for me...

any ideas?

thanks
randelld
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Randell D. wrote:
If I have a number that includes decimal points and I want to remove
everything right of the decimal, how do I do it


floor()
Jul 16 '05 #2

P: n/a

"Dana" <Da**@nospamnexlab.it> wrote in message
news:bi**********@newsreader.mailgate.org...
Randell D. wrote:
If I have a number that includes decimal points and I want to remove
everything right of the decimal, how do I do it


floor()


Many thanks - I never heard of the function before nor would I have ever
guessed it.

Cheers.
Jul 16 '05 #3

P: n/a
Randell D. wrote:
"Dana" <Da**@nospamnexlab.it> wrote in message
news:bi**********@newsreader.mailgate.org...
Randell D. wrote:
If I have a number that includes decimal points and I want to remove
everything right of the decimal, how do I do it


floor()

Many thanks - I never heard of the function before nor would I have ever
guessed it.

Cheers.


you were close yourself anyway:

$t=1.532;
$y=(int)$t;

should work too

Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.