From e9e5678a0ab6d1ed127b5ecb64f56b0dda6a6353 Mon Sep 17 00:00:00 2001 From: Hikari Date: Mon, 6 Apr 2026 16:27:02 -0700 Subject: [PATCH] fix: use Math.round in formatInteger letter suffix to avoid floating-point truncation --- apps/web/src/utils/format.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/utils/format.ts b/apps/web/src/utils/format.ts index 7d88cef..101f22a 100644 --- a/apps/web/src/utils/format.ts +++ b/apps/web/src/utils/format.ts @@ -127,7 +127,7 @@ const formatInteger = (value: number): string => { const steps = stepsAboveBase * 3; const divisorExp = letterBaseExp + steps; const divisor = Math.pow(10, divisorExp); - return `${String(Math.floor(value / divisor))}${getLetterSuffix(stepsAboveBase)}`; + return `${String(Math.round(value / divisor))}${getLetterSuffix(stepsAboveBase)}`; } for (const { threshold, suffix } of namedSuffixes) { if (value >= threshold) {