seems to work fine for me.
what are your results when you do this? mine are 0.4 and this is what is
should be. if it were .349 it would round down. isn't this how it should
work? What were your results?
----- Original Message -----
From: "George Whiffen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 2:36 AM
Subject: Re: [PHP] rounding a number
> Jason Wong wrote:
> > On Monday 24 June 2002 11:34, Phil Schwarzmann wrote:
> > > I want to round a number to the nearest decimal place...
> > >
> > > if the number is 4.623, I want it to display 4.6
> > > if the number is 2.36, I want it to display 2.7
> > You don't really mean 2.36 --> 2.7 ??
> > > Is there a function that does this? round(), ceil(), floor() don't do
> > > this and I've checked through all the math functions in my handy-dandy
> > > "PHP Functions" reference book.
> > round() seems to work. What's the problem you're having?
> It's worth noting that round doesn't always work e.g.
> try round(0.35,1)....
> > --
> > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > /*
> > That's no moon...
> > -- Obi-wan Kenobi
> > */
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php