BUGFIX: Update formatPercent to not use a suffixStart of 0 (#1024)

This commit is contained in:
TheAimMan 2024-01-08 10:25:20 -05:00 committed by GitHub
parent 7017f3c2f8
commit 82511e5030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -101,7 +101,7 @@ export function formatPercent(n: number, fractionalDigits = 2, multStart = 1e6)
if (nAbs * 100 === Infinity) return n < 0 ? "-∞%" : "∞%";
// Mult form. There are probably some areas in the game this wouldn't make sense, but they hopefully won't ever have huge %.
if (nAbs >= multStart) return "x" + formatNumber(n, fractionalDigits, 0);
if (nAbs >= multStart) return "x" + formatNumber(n, fractionalDigits);
return getFormatter(fractionalDigits, percentFormats, { style: "percent" }).format(n);
}