From f5213e81582888c012a4135e6b5e533937a60a78 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Wed, 21 Oct 2020 21:18:39 -0400 Subject: [PATCH] Fixed precision displaying wrong --- changelog.md | 2 ++ js/utils.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 859d8bd..04bb392 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- Fixed some numbers not displaying with enough digits. + ### v2.1.3.1 - 10/21/20 - Fixed the update function. diff --git a/js/utils.js b/js/utils.js index 70a59f4..d4e0508 100644 --- a/js/utils.js +++ b/js/utils.js @@ -52,6 +52,8 @@ function format(decimal, precision=2) { } function formatWhole(decimal) { + decimal = new Decimal(decimal) + if (decimal.gte(1e9)) return format(decimal, 2) return format(decimal, 0) }