RE: [PHP] keeping the last zero

From: Date: Mon, 17 May 2004 11:05:52 +0000
Subject: RE: [PHP] keeping the last zero
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-186401@lists.php.net to get a copy of this message
I prefer: round($value,2); -----Original Message----- From: Marek Kilimajer [mailto:kilimajer@webglobe.sk] Sent: Monday, May 17, 2004 5:10 AM To: Mario Cc: php-general@lists.php.net Subject: Re: [PHP] keeping the last zero Mario wrote: > Hi all > > I have a list of products with prices > e.g. > > $100 > $100.50 > (those are examples, they can be anything, not all prices have > decimal) > > when I add those I get $200.5. > > Is there a way to get $200.50. > > Thanks > > Mario You want to format the number? Use number_format() PS: Don't hijack threads. http://www.google.com/search?q=what+is+%22thread+hijacking%22 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#186401) next »