aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2023-06-19 19:23:43 +0200
committerGitHub <noreply@github.com>2023-06-19 19:23:43 +0200
commita82819ec18bed8212fa73fda987cff951b810450 (patch)
tree2e18b55a6870ce5bd75516dd140ab3e6441054e5 /src/main/kotlin
parent7fd26d14e742c974ec50686c375ccdfd9c968faf (diff)
downloadNotEnoughUpdates-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')
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt3
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")