I prefer:

round($value,2);

-----Original Message-----
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 17, 2004 5:10 AM
To: Mario
Cc: [EMAIL PROTECTED]
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to