I need to calculate a win loss ratio from my app in PHP (Laravel 5.2)
I have these two numbers:
$array['WinLoss'] = $array['GamesWon'] / $array['TotalGamesLost'];
Which gives me:
Win: 480
Loss: 400
I tried doing this in my view:
{{ round((float)$WinLoss * 100) . '%' }}
but it gives me 120%. Thats obviously not correct, it should be around 58%
How would I calculate to show around 58% not 120%?