Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Calculating Discount Percentage of a given discounted price

I am trying to find out the discount amount of a price.

The cost of item WAS £50.00 Sale Price £25.00 Discount = %50

However when use this formula below in PHP it doesnt give me the correct Discount percentage.

$percent = $rowx->Orgprice - $rowx->SalePrice / 100;
$percent =  50 - 25 / 100 = 49.75; 
$percent =  50 - 20 / 100 = 49.8;

All above percentages are wrong.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Use this formula for calculating the discount percentage :

Discount%=(Original Price - Sale price)/Original price*100

Translating it into code, it should be something like :

$percent = (($rowx->Orgprice - $rowx->SalePrice)*100) /$rowx->Orgprice ;
about 4 years ago · Santiago Trujillo Report

0

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
about 4 years ago · Santiago Trujillo Report

0

The correct formula is 1 - (sale price / original) * 100, so:

$percent = 1 - ($rowx->SalePrice / $rowx->Orgprice) * 100;
$percent = 1 - (25 / 50) * 100 = 50
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!