diff --git a/changelog.md b/changelog.md index c7b8ae7..1ddca4e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # The Modding Tree changelog: - Tooltips can now show over the top overlay again. +- Tweaked number formatting (e1000's keep the decimal places on the mantissa.) - Fixed text on two settings buttons not changing. ### v2.5.9.2 - 5/19/21 diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index 7a0a7d8..87349bc 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -54,8 +54,8 @@ function format(decimal, precision = 2, small) { if (slog.gte(1e6)) return "F" + format(slog.floor()) else return Decimal.pow(10, slog.sub(slog.floor())).toStringWithDecimalPlaces(3) + "F" + commaFormat(slog.floor(), 0) } - else if (decimal.gte("1e100000")) return exponentialFormat(decimal, 0, false) - else if (decimal.gte("1e1000")) return exponentialFormat(decimal, 0) + else if (decimal.gte("1e1000000")) return exponentialFormat(decimal, 0, false) + else if (decimal.gte("1e10000")) return exponentialFormat(decimal, 0) else if (decimal.gte(1e9)) return exponentialFormat(decimal, precision) else if (decimal.gte(1e3)) return commaFormat(decimal, 0) else if (decimal.gte(0.0001) || !small) return regularFormat(decimal, precision) @@ -75,7 +75,7 @@ function format(decimal, precision = 2, small) { function formatWhole(decimal) { decimal = new Decimal(decimal) if (decimal.gte(1e9)) return format(decimal, 2) - if (decimal.lte(0.98) && !decimal.eq(0)) return format(decimal, 2) + if (decimal.lte(0.99) && !decimal.eq(0)) return format(decimal, 2) return format(decimal, 0) }