mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
UI: Add option to set fractional digits (#2419)
This commit is contained in:
@@ -119,7 +119,12 @@ export function formatPercent(n: number, fractionalDigits = 2, multStart = 1e6)
|
||||
return getFormatter(fractionalDigits, percentFormats, { style: "percent" }).format(n);
|
||||
}
|
||||
|
||||
export function formatNumber(n: number, fractionalDigits = 3, suffixStart = 1000, isInteger = false) {
|
||||
export function formatNumber(
|
||||
n: number,
|
||||
fractionalDigits = Settings.fractionalDigits,
|
||||
suffixStart = 1000,
|
||||
isInteger = false,
|
||||
) {
|
||||
// NaN does not get formatted
|
||||
if (Number.isNaN(n)) return "NaN";
|
||||
const nAbs = Math.abs(n);
|
||||
|
||||
Reference in New Issue
Block a user