6
I have a variable that dynamically receives from the database, a floating number that is the percentage to be taken out of a certain value. How do I take this percentage away from a value?
For example:
$total = 4000;
$pctm = 30.00;
$valor_descontado = $total-$pctm.'%';
But that way, it doesn’t work.
Resolved, thanks not only to you, but to all.
– Michel Henriq
@Maniero, how do I get the percentage of the subtraction result of 2500000 by 1950000. I tried with the proposal ai, but it does not work, it does not return the value of the percentage. Is it because the number is large? It has how to do this?
– John Quimera
@Maniero I want to know what is the percentage of the number I subtract. For example. My product costs 100 real, I will give a discount of 25 real, IE decrease... is a simple account we already know head to head that the percentage of 100 real minus 25 is 25%. But what for larger numbers? For example, what is the percentage of 5 million - minus 1 million seven hundred and fifty thousand and 80 reais? I am searching for "%%% "of the result of the number I just subtracted...
– John Quimera