From a1cb21d98ee692aa5241d9fed92c081b7c3e9af2 Mon Sep 17 00:00:00 2001 From: Vekki000 <71082240+Vekki000@users.noreply.github.com> Date: Sun, 5 Sep 2021 22:37:26 +0300 Subject: [PATCH] Global percent decimal fix --- src/client/commands/statistics.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/commands/statistics.js b/src/client/commands/statistics.js index b96ef04..c920939 100644 --- a/src/client/commands/statistics.js +++ b/src/client/commands/statistics.js @@ -1,5 +1,6 @@ import Discord from "discord.js"; + module.exports = { name: 'statistics', description: 'Show statistics', @@ -24,7 +25,7 @@ module.exports = { if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) > 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) > 0){ statistics += `**${parseInt(station) + 1}. ` + stations[station].name + "** \n"; if(global && global.statistics[stations[station].name] && global.statistics[stations[station].name].time && parseInt(global.statistics[stations[station].name].time) > 0 && global.statistics[stations[station].name].used && parseInt(global.statistics[stations[station].name].used) > 0){ - statistics += "Guild – Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " (" + ((currentGuild.statistics[stations[station].name].time / global.statistics[stations[station].name].time) * 100) + "%" + ")" + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + " (" + ((currentGuild.statistics[stations[station].name].used / global.statistics[stations[station].name].used) * 100) + "%" + ")" + "\n"; + statistics += "Guild – Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " (" + ((currentGuild.statistics[stations[station].name].time / global.statistics[stations[station].name].time) * 100).toFixed(2) + "%" + ")" + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + " (" + ((currentGuild.statistics[stations[station].name].used / global.statistics[stations[station].name].used) * 100).toFixed(2) + "%" + ")" + "\n"; statistics += "Global – Time: " + client.funcs.msToTime(global.statistics[stations[station].name].time) + " / " + "Used: " + global.statistics[stations[station].name].used + "\n\n"; } else { statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + "\n\n";