aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUCalculator.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUCalculator.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUCalculator.kt
new file mode 100644
index 000000000..1b017fea1
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUCalculator.kt
@@ -0,0 +1,10 @@
+package at.hannibal2.skyhanni.utils
+
+import io.github.moulberry.notenoughupdates.util.Calculator
+import java.math.BigDecimal
+
+object NEUCalculator {
+
+ // TODO add if (!usingNEU()) null
+ fun calculateOrNull(input: String): BigDecimal? = runCatching { Calculator.calculate(input) }.getOrNull()
+}