diff options
author | Roman / Linnea Gräf <roman.graef@gmail.com> | 2023-06-19 19:23:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 19:23:43 +0200 |
commit | a82819ec18bed8212fa73fda987cff951b810450 (patch) | |
tree | 2e18b55a6870ce5bd75516dd140ab3e6441054e5 /src/main/kotlin/io | |
parent | 7fd26d14e742c974ec50686c375ccdfd9c968faf (diff) | |
download | NotEnoughUpdates-a82819ec18bed8212fa73fda987cff951b810450.tar.gz NotEnoughUpdates-a82819ec18bed8212fa73fda987cff951b810450.tar.bz2 NotEnoughUpdates-a82819ec18bed8212fa73fda987cff951b810450.zip |
Add variables to calculator (#721)
* Add variables to calculator
* Fix unary minus for variables
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt | 3 |
1 files changed, 2 insertions, 1 deletions
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") |