mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-22 00:21:32 +00:00
Fixed number formatting issues
This commit is contained in:
parent
6d47089870
commit
9807531872
3 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
# The Modding Tree changelog:
|
# The Modding Tree changelog:
|
||||||
|
- Fixed formatting for some larger numbers.
|
||||||
- Fixed styling challenges.
|
- Fixed styling challenges.
|
||||||
- No longer attempts to display a base currency when there is none.
|
- No longer attempts to display a base currency when there is none.
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ function exponentialFormat(num, precision, mantissa = true) {
|
||||||
m = new Decimal(1)
|
m = new Decimal(1)
|
||||||
e = e.add(1)
|
e = e.add(1)
|
||||||
}
|
}
|
||||||
e = (e.gte(10000) ? commaFormat(e, 0) : e.toStringWithDecimalPlaces(0))
|
e = (e.gte(1e9) ? format(e, 1) : (e.gte(10000) ? commaFormat(e, 0) : e.toStringWithDecimalPlaces(0)))
|
||||||
if (mantissa)
|
if (mantissa)
|
||||||
return m.toStringWithDecimalPlaces(precision) + "e" + e
|
return m.toStringWithDecimalPlaces(precision) + "e" + e
|
||||||
else return "e" + e
|
else return "e" + e
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// ************ Save stuff ************
|
// ************ Save stuff ************
|
||||||
function save() {
|
function save() {
|
||||||
localStorage.setItem(modInfo.id, btoa(JSON.stringify(player)));
|
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(player)))));
|
||||||
}
|
}
|
||||||
function startPlayerBase() {
|
function startPlayerBase() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue