RE: [PHP] Formatting Percents
| From: | David Smith | Date: | Fri, 17 Aug 2001 04:56:53 +0000 |
| Subject: | RE: [PHP] Formatting Percents | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63131@lists.php.net to get a copy of this message | ||
DOH, wouldn't you know it. As soon as I sent these messages I found my
answer...
$sellprice = round ($bprice, 2);
-----Original Message-----
From: David Smith [mailto:webmaster@123giftshopping.com]
Sent: Thursday, August 16, 2001 11:50 PM
To: David Smith; php-general@lists.php.net
Subject: RE: [PHP] Formatting Percents
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?
-----Original Message-----
From: David Smith [mailto:webmaster@123giftshopping.com]
Sent: Thursday, August 16, 2001 11:31 PM
To: php-general@lists.php.net
Subject: [PHP] Formatting Percents
Importance: High
Hello everyone,
I am having a problem and can't seem to find an answer. Maybe someone here
can help. I have a gift store that has prices of items. Well each item has a
retail price that I have added to the DB. Let's say I want to sell the
products at a discount of 15% but I don't want to change all the records. I
want to use PHP to configure the 15% off price. How does one do this? Does
the MySQL field need to be formatted a certain way?
I want to show:
Retail Price: $100.00
Your Price: $85.00
Thanks in advance and let me know if you need more information.
David Smith
Indy Web Design
877-347-1270 or 317-573-2486
http://www.indywebdesign.com
--------------------------------------
Visit our online gift store at http://www.123giftshopping.com.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net