Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

formula for discount

Tags:

php

math

formula

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;
like image 493
Bharanikumar Avatar asked Nov 06 '10 11:11

Bharanikumar


People also ask

What is the formula to calculate discount?

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.

What is the formula for 20% off?

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.


1 Answers

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
like image 92
Darin Dimitrov Avatar answered Sep 23 '22 04:09

Darin Dimitrov