Skip to content

Commit

Permalink
fix divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
JimGeersinga committed Mar 16, 2024
1 parent 767044d commit 3503175
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion NED.WoT.BattleResults.Client/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
var draws = context.Items.Count(x => x.IsDraw());
var unknowns = context.Items.Count(x => x.IsUnkown());

var winPercentage = 100m / (wins+loses+draws) * wins;
var totalBattles = wins + loses + draws;
var winPercentage = 0m;
if (totalBattles > 0)
{
winPercentage = 100m / totalBattles * wins;
}
var percentage_color = winPercentage > 50 ? "Win" : winPercentage < 40 ? "Lose" : "Draw";

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity Name="maui-package-name-placeholder" Publisher="CN=JimG" Version="1.8.1.0" />
<Identity Name="maui-package-name-placeholder" Publisher="CN=JimG" Version="1.8.2.0" />

<mp:PhoneIdentity PhoneProductId="3DAE7680-3F65-440F-908F-252D648F20FC" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down

0 comments on commit 3503175

Please sign in to comment.