From e0a2f5f5991048317f5c045feca084a1413c45fd Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 18 Oct 2023 16:12:19 +0200 Subject: Add calculator precision option (#882) * Add calculator precision option * Fix loading of minecraft classes from some tests --- .../io/github/moulberry/notenoughupdates/commands/misc/MiscCommands.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (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 64ee444b..422871b4 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 @@ -40,7 +40,6 @@ import net.minecraft.client.renderer.OpenGlHelper import net.minecraft.util.ChatComponentText import net.minecraft.util.EnumChatFormatting.* import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import java.text.DecimalFormat import java.util.* import java.util.concurrent.CompletableFuture @@ -53,7 +52,7 @@ class MiscCommands { val calculation = this[calculation] try { val calculate = Calculator.calculate(calculation, NeuSearchCalculator.PROVIDE_LOWEST_BIN) - val formatter = DecimalFormat("#,##0.##") + val formatter = Calculator.getDecimalFormat() val formatted = formatter.format(calculate) reply("$WHITE$calculation $YELLOW= $GREEN$formatted") } catch (e: CalculatorException) { -- cgit