hello folks,

i am programing my own match betting calculator and i fell something is not right with the formulas used...

PHP Code:

```
function stakeReturnCalculate(backOdds, backStake, layOdds, layComission, snr)
```

{

var output =[4];

var stakeNotReturned = snr * backStake; // snr is 1 or 0 (freebet or not freebet)

var backReturn = backOdds * backStake - (layComission* ((backOdds -1 ) * backStake)/100) - stakeNotReturned;

var layStake = backReturn/(layOdds - (layComission / 100));

var layLiability = (layOdds -1) * layStake;

var layReturn = layStake * ((1 - layComission)/100);

var profit1 = backReturn - layLiability;

var profit2 = layReturn - backStake;

//if evrything alright ( profit1 - profit2 < 0.05 )

// return 1 and 2 is suposed to be be the return in %

var return1 = profit1 / layStake *100;

var return2 = profit2 / backStake *100;

}

Can someone check if the calculations are correct?