mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
Improved smallish number display
This commit is contained in:
parent
61c5baeadc
commit
b5591197a6
4 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue