Skip to content

Commit

Permalink
BUGFIX: Update formatPercent to not use a suffixStart of 0 (bitburner…
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAimMan authored and G4mingJon4s committed Mar 23, 2024
1 parent 1589a4c commit b0960f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/formatNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b0960f3

Please sign in to comment.