Re: Rounding off to two decimal places

From: Date: Thu, 02 Nov 2000 21:03:13 +0000
Subject: Re: Rounding off to two decimal places
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23456@lists.php.net to get a copy of this message
<? echo $font[1].numberformat($quota_units_max,2); ?></font> --Joe On Thu, Nov 02, 2000 at 04:00:15PM -0000, Ben.Joyce@idesk.com wrote: > Hi. I've just joined the list today so "Hello", etc etc. > > I'm from an ASP background (argh! that hurt!) and I have a question > regarding rounding off a number. > > I'm trying the following: > > <td><?echo $font[1].$quota_units_max?></font></td> > > When this line is executed the value of $quota_units_max is 4.9998350143433. > I'd like to display 4.99 (or 5.00, if I have to). on > http://uk.php.net/manual/function.round.php it says I should be > able to do > this: > > $quota_units_max = round ($quota_units_max, 2); > > When I try this I get the following error: > > Warning: Wrong parameter count for round() > > Any ideas? > > Cheers, > > .b > > > > _________________________________________________________________ > The information contained in this email is confidential and is intended only for > the use of the named addressee. If the reader of this message is not the > named addressee, you are hereby notified that any use of this email or its > contents, including dissemination or copying, is strictly prohibited. If you have > received this email in error please notify the IT manager by telephone on > 0208 537 7745 or via email to sg1@idesk.com, including a copy of this > message. Please then delete this email and destroy any copies. > > idesk plc > Registered office > 190 The Strand > London > WC2R 1JN > 2929301 > _________________________________________________________________ ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#23456) next »