From 84b03cfb5b6c86c327c27c0a300e7e8c3ba23d3c Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 14 Dec 2017 22:27:47 +0000 Subject: [PATCH] Fix --- commands/number-edit/final-grade-calculator.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/commands/number-edit/final-grade-calculator.js b/commands/number-edit/final-grade-calculator.js index c69f3b65..268abd85 100644 --- a/commands/number-edit/final-grade-calculator.js +++ b/commands/number-edit/final-grade-calculator.js @@ -36,9 +36,7 @@ module.exports = class FinalGradeCalculatorCommand extends Command { } run(msg, { current, desired, weight }) { - const weightDecimal = weight / 100; - const remainingWeight = 1 - weightDecimal; - const required = Math.round(((desired - (current * remainingWeight)) / weightDecimal) * 100); + const required = Math.round((((desired / 100) - ((current / 100) * (1 - (weight / 100)))) / (weight / 100)) * 100); const diff = current - desired; let text; if (required > 100) text = above100[Math.floor(Math.random() * above100.length)];