Page 1 of 1

cut everything after the comma

Posted: Fri Sep 17, 2004 4:11 am
by potato
Hi,

long time no see :) !
For a star rating script, i have to cut off everything behind the comma, like:
4.333 would be 4.

Anybody knows how to do it?

Thanx in advance!

Posted: Fri Sep 17, 2004 4:12 am
by feyd

Code: Select all

(int)4.333

Posted: Fri Sep 17, 2004 4:26 am
by potato
Thanx man!

I reall like this forum, specially for the fast answers.
That's how it should be.

devnetwork rulez

Posted: Fri Sep 17, 2004 6:18 am
by John Cartwright
if you want to round it [php_man]ceil()[/php_man] up

Posted: Fri Sep 17, 2004 6:21 am
by dethron
and do not forget [php_man]floor()[/php_man] :)