From a82819ec18bed8212fa73fda987cff951b810450 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Mon, 19 Jun 2023 19:23:43 +0200 Subject: Add variables to calculator (#721) * Add variables to calculator * Fix unary minus for variables --- .../io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/io') diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt index caa57909..64ee444b 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt @@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.events.RegisterBrigadierCommandEvent import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay import io.github.moulberry.notenoughupdates.miscgui.DynamicLightItemsEditor import io.github.moulberry.notenoughupdates.miscgui.GuiItemCustomize +import io.github.moulberry.notenoughupdates.miscgui.NeuSearchCalculator import io.github.moulberry.notenoughupdates.util.Calculator import io.github.moulberry.notenoughupdates.util.Calculator.CalculatorException import io.github.moulberry.notenoughupdates.util.MinecraftExecutor @@ -51,7 +52,7 @@ class MiscCommands { thenArgumentExecute("calculation", RestArgumentType) { calculation -> val calculation = this[calculation] try { - val calculate = Calculator.calculate(calculation) + val calculate = Calculator.calculate(calculation, NeuSearchCalculator.PROVIDE_LOWEST_BIN) val formatter = DecimalFormat("#,##0.##") val formatted = formatter.format(calculate) reply("$WHITE$calculation $YELLOW= $GREEN$formatted") -- cgit