From 2627cc24b1b9385a96440b5a3e767551888afea2 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 25 Jan 2023 23:14:40 -0500 Subject: [PATCH] Fix float math --- modules/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/functions.js b/modules/functions.js index bf86135..a3e86ca 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -210,9 +210,9 @@ const functions = { const currentHeightDifference = guildInfo.treeHeight - leaderboardEntry.treeHeight; if (currentHeightDifference > 0) { // Guild Tree is taller than the leaderboard tree - comparisonReplyString += `#${leaderboardEntry.treeRank} - ${currentHeightDifference}ft taller`; + comparisonReplyString += `#${leaderboardEntry.treeRank} - ${currentHeightDifference.toFixed(1)}ft taller`; } else { - comparisonReplyString += `#${leaderboardEntry.treeRank} - ${Math.abs(currentHeightDifference)}ft shorter`; + comparisonReplyString += `#${leaderboardEntry.treeRank} - ${Math.abs(currentHeightDifference).toFixed(1)}ft shorter`; } // Build a string using the current leaderboard entry and the historic entry from 24 hours ago comparisonReplyString += ` ${statusIndicator}\n`;