1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 09:21:46 +00:00

Fixed number formatting issues

This commit is contained in:
Harley White 2021-04-07 14:27:40 -04:00
parent 6d47089870
commit 9807531872
3 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
# The Modding Tree changelog:
- Fixed formatting for some larger numbers.
- Fixed styling challenges.
- No longer attempts to display a base currency when there is none.

View file

@ -6,7 +6,7 @@ function exponentialFormat(num, precision, mantissa = true) {
m = new Decimal(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)
return m.toStringWithDecimalPlaces(precision) + "e" + e
else return "e" + e

View file

@ -1,6 +1,6 @@
// ************ Save stuff ************
function save() {
localStorage.setItem(modInfo.id, btoa(JSON.stringify(player)));
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(player)))));
}
function startPlayerBase() {
return {