On Fri, 17 Aug 2001 14:19, David Smith wrote:
> What I have in code.
>
> If the retail price is $139.95 and I use the following:
>
> $aprice = $hotbuys["price"] * .15;   // Determine Discount
> $bprice = $hotbuys["price"] - $aprice;  // Subtract Discount
>
> $bprice = 118.9575
>
> How can I format that to just 118.96?

$discount = .15;
$discount_price = number_format($hotbuys["price"]*(1-$discount), 2)

should do something like what you want.


-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   It's smart to pick your friends, but not to pieces.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to