Home > php教程 > php手册 > php 团购折扣计算公式

php 团购折扣计算公式

WBOY
Release: 2016-06-13 12:04:22
Original
1609 people have browsed it

复制代码 代码如下:


$price=$row['price']; //原价
$nowprice=$row['nowprice']; //现价
$jiesheng=$price-$nowprice; //节省金额
//$discount折扣计算
if ( $nowprice > 0 )
{
$discount = round(10 / ($price / $nowprice), 1);
}
else
{
$discount = 0;
}
if ( $discount



完整代码:

复制代码 代码如下:






source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template