Re: FN-FORUM: PHP Float
date posted 5th August 2003 17:50
Rus Foster wrote:
> Hi All,
> Last questions for the day. I've got a string that say could be 123.4 or
> 123.323. How would I get it to 123.00. I've got the number in a variable
> which I then went to put into another varible (this case a session
> handeler)
> so I've got
> $no="123.321";
> I've tried B
> $foo= (int) ($no);
> but didn't work. Can someone give me a push please
Have a look at round(), ceil() and floor() any one of which might do
what you want, depending on context. The following should help you
work it out, if you don't have the manual to hand:
Cheers,
Pete
--
Peter Croft
PC Associates