Bharanikumar
Bharanikumar

Reputation: 25733

formula for discount

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;

Upvotes: 7

Views: 36762

Answers (2)

Lonare
Lonare

Reputation: 4663

Like Literally you can copy paste this formula:

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

Upvotes: 2

Darin Dimitrov
Darin Dimitrov

Reputation: 1038720

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

Upvotes: 22

Related Questions