From 36b23d314f1efb26af30d0c2a4da36f9ceabce08 Mon Sep 17 00:00:00 2001 From: bijx Date: Tue, 30 Jun 2026 15:09:30 -0400 Subject: [PATCH] QoL: Add billions to money utils (#4460) ## Description: A simple QoL to handle cases where money surpasses $1B. I have seen this happen in both custom games and post-game, and generally looks nicer than just showing a thousand millions. image ## 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 ## Please put your Discord username so you can be contacted if a bug or regression is found: bijx --- src/client/Utils.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/Utils.ts b/src/client/Utils.ts index 709067434..2b67df29b 100644 --- a/src/client/Utils.ts +++ b/src/client/Utils.ts @@ -285,7 +285,13 @@ export function renderNumber( num = Number(num); num = Math.max(num, 0); - if (num >= 10_000_000) { + if (num >= 10_000_000_000) { + const value = Math.floor(num / 100000000) / 10; + return value.toFixed(fixedPoints ?? 1) + "B"; + } else if (num >= 1_000_000_000) { + const value = Math.floor(num / 10000000) / 100; + return value.toFixed(fixedPoints ?? 2) + "B"; + } else if (num >= 10_000_000) { const value = Math.floor(num / 100000) / 10; return value.toFixed(fixedPoints ?? 1) + "M"; } else if (num >= 1_000_000) {