get real price of a discount package applied

0

I have a doubt to get the real price of a box x, if the price that is given is 521.53 already with a 12% discount applied what is the real price without the discount applied?

    
asked by Rodo Juarez 09.09.2017 в 23:10
source

2 answers

0

First: To get to 521.53 the discount was applied in this way:
X (1 - 0.12) = 521.53
If you solve for X you get this:
X = 521.53 / 0.88 which is approximately 592.65

    
answered by 09.09.2017 в 23:28
0

If you know the final price $dblPrecioFinal and the discount applied $dblPorCiento , the formula, which serves to obtain the real price is:

$dblPrecioReal = $dblPrecioFinal/(1-$dblPorCiento); 

Example:

Demo in Rextester

$dblPrecioFinal=521.53;
$dblPorCiento=.12;

$dblPrecioReal = $dblPrecioFinal/(1-$dblPorCiento); 

echo "PRECIO REAL: ";
echo round($dblPrecioReal,2);

Resultado:

PRECIO REAL: 592.65

How does it work?

  • (a) Subtract one from the percentage applied: 1-0.12 = 0.88
  • (b) The final price is divided by the value obtained in (a): 521.53/.088
  • (c) Result: 592.65 using round to round decimals and use only two decimal digits.
answered by 10.09.2017 в 00:08