From b5591197a6b603823818333b316554c6af00f1f0 Mon Sep 17 00:00:00 2001 From: Harley White Date: Mon, 10 May 2021 18:43:04 -0400 Subject: [PATCH] Improved smallish number display --- changelog.md | 4 +++- js/Demo/demoMod.js | 2 +- js/game.js | 2 +- js/utils/NumberFormating.js | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 8f5c37a..e3a74c6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,10 @@ # The Modding Tree changelog: +# v2.5.4 - - Added a setting to always use single-tab mode. -- Added directMult, which multiplies gain after exponents and softcaps. It actually multiplies gain for static layers. +- Added directMult, which multiplies prestige gain after exponents and softcaps. It actually multiplies gain for static layers. - Added onEnter and onExit for challenges. +- Improved displaying numbers between 0.0001 and 0.1 - Added documentation on how gainMult/Exp work for static layers. # v2.5.3 - 5/8/21 diff --git a/js/Demo/demoMod.js b/js/Demo/demoMod.js index 98a54dc..0808770 100644 --- a/js/Demo/demoMod.js +++ b/js/Demo/demoMod.js @@ -11,7 +11,7 @@ let modInfo = { // Set your version in num and name let VERSION = { - num: "2.5.3", + num: "2.5.4", name: "Dreams Really Do Come True", } diff --git a/js/game.js b/js/game.js index f743d3f..13b46c2 100644 --- a/js/game.js +++ b/js/game.js @@ -5,7 +5,7 @@ var scrolled = false; // Don't change this const TMT_VERSION = { - tmtNum: "2.5.3", + tmtNum: "2.5.4", tmtName: "Dreams Really Do Come True" } diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index 62b6e9b..fe29dc1 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -21,8 +21,8 @@ function commaFormat(num, precision) { function regularFormat(num, precision) { if (num === null || num === undefined) return "NaN" - if (num.mag < 0.001) return (0).toFixed(precision) - if (num.mag < 0.01) precision = 3 + if (num.mag < 0.0001) return (0).toFixed(precision) + if (num.mag < 0.1 && precision !==0) precision = 4 return num.toStringWithDecimalPlaces(precision) } @@ -54,7 +54,7 @@ function format(decimal, precision = 2, small) { else if (decimal.gte("1e1000")) 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.001) || !small) return regularFormat(decimal, precision) + else if (decimal.gte(0.0001) || !small) return regularFormat(decimal, precision) else if (decimal.eq(0)) return (0).toFixed(precision) decimal = invertOOM(decimal)