diff --git a/changelog.md b/changelog.md index 3a5c5fc..c4f51a4 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index 852c15c..0bd5265 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -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 diff --git a/js/utils/save.js b/js/utils/save.js index 7f9ced2..388c7d2 100644 --- a/js/utils/save.js +++ b/js/utils/save.js @@ -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 {