php 折扣公式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4112837/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:00:29  来源:igfitidea点击:

formula for discount

phpmathformula

提问by Bharanikumar

What is the formula for discount,

折扣的公式是什么

in php is there any default function ,

在 php 中是否有任何默认功能,

this is my formula, chk it is correct way ,

这是我的公式,这是正确的方法,

  $SELLING_PRICE = $ACTUAL_PRICE-$CHK_DISCOUNT_THERE;
  $PRICE_AFTER_DISCOUNT = $ACTUAL_PRICE-$SELLING_PRICE;

回答by Darin Dimitrov

selling price = actual price - (actual price * (discount / 100))

So for example if (actual price) = $15, (discount) = 5%

例如,如果(实际价格)= 15 美元,(折扣)= 5%

selling price = 15 - (15 * (5 / 100)) = .25

回答by Harshal Lonare

Like Literally you can copy paste this formula:

就像字面意思一样,您可以复制粘贴此公式:

$total = $total - ($total * ($discount_amount/100));