RE: [PHP] What to use?

From: Date: Thu, 25 Sep 2003 20:28:10 +0000
Subject: RE: [PHP] What to use?
Groups: php.general 
Request: Send a blank email to php-general+get-163996@lists.php.net to get a copy of this message
Correct me if I'm wrong please, but I think number_format() has the adverse effect of changing the value type from numeric to char and therefore baring you from using it in mathematical equation later in the script. Anyway that's what it seemed to do to me when I used it on results from a MySQL query... Jeff > -----Original Message----- > From: Tyler Lane [mailto:tlane@lyrical.net] > Sent: Thursday, September 25, 2003 4:20 PM > To: php-general@lists.php.net > Subject: Re: [PHP] What to use? > > > round() > and number_format() are what i would suggest using. > > On Thu, 2003-09-25 at 13:01, Ryan A wrote: > > Hi, > > I am running a query on the database to get the avg of a > few fields, I > > am getting a result something like this: > > > > 5.0000 > > 4.0000 > > 5.0000 > > > > I dont want to use such big averages and want to cut the last to > > digits off so it will be something like: 5.00 > > 4.00 > > 44.23 > > etc > > > > I visited the manual and had a look at a few functions like trim, > > rtrim,ltrim,chop,explode etc....which one is right for me? most of > > them are dealing with whitespace so it does not make much > sense right > > now with my current output.... > > > > Please help. > > > > Thanks, > > -Ryan > > > > > > > > > > We will slaughter you all! - The Iraqi (Dis)information > ministers site > > http://MrSahaf.com > -- > Tyler Lane <tlane@lyrical.net> > Lyrical Communications > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#163996) next »