From 144920eb53451f2652c1e2860b9b741e368a2ba7 Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Fri, 17 Oct 2025 04:49:46 +0200 Subject: [PATCH] Fix 100% owned in team stats (#2217) ## Description: When a team owns 100% of the land, it would show "1.0e2%" because of toPrecision(2). Fix this by keeping the same precision as for other numbers, but just returning 100 for 100%. It probably wasn't really noticed before since full land ownership doesn't occur much. Chances of 100% in team stats are a bit higher since fallout is now taken into account. Only a picture of the before situation: 100 percent ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33 --- src/client/graphics/layers/TeamStats.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/graphics/layers/TeamStats.ts b/src/client/graphics/layers/TeamStats.ts index ba8e9dbe7..a8503c229 100644 --- a/src/client/graphics/layers/TeamStats.ts +++ b/src/client/graphics/layers/TeamStats.ts @@ -221,5 +221,6 @@ export class TeamStats extends LitElement implements Layer { function formatPercentage(value: number): string { const perc = value * 100; if (Number.isNaN(perc)) return "0%"; + if (perc === 100) return "100%"; return perc.toPrecision(2) + "%"; }