Considering the following data:
$despesas = 2000;
$receitas = 100;
$lucroprejuizo = ($receitas - $despesas) / $receitas)*100;
I have a result of: -1900%
But if any of the variable revenue or expenditure is zero the calculation is wrong because it will be dividing by zero. Is there any way to calculate?
For example, if we consider that I had 0,00
revenue and 300,00
expenditure it will have -100% profit margin.