What is the formula for discount,
in php is there any default function ,
this is my formula, chk it is correct way ,
$SELLING_PRICE = $ACTUAL_PRICE-$CHK_DISCOUNT_THERE;
$PRICE_AFTER_DISCOUNT = $ACTUAL_PRICE-$SELLING_PRICE;
Subtract the final price from the original price. Divide this number by the original price. Finally, multiply the result by 100. You've obtained a discount in percentages.
First, convert the percentage discount to a decimal. A 20 percent discount is 0.20 in decimal format. Secondly, multiply the decimal discount by the price of the item to determine the savings in dollars. For example, if the original price of the item equals $24, you would multiply 0.2 by $24 to get $4.80.
selling price = actual price - (actual price * (discount / 100))
So for example if (actual price) = $15, (discount) = 5%
selling price = 15 - (15 * (5 / 100)) = $14.25
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With