aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/garden
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-26 16:50:03 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-02-26 16:50:03 +0100
commit3bc84f50fcb86abbe956c9ccbdf52cbdb563af47 (patch)
tree3acbd598220fee7b40894aa664e0993b43e3cdb5 /src/main/java/at/hannibal2/skyhanni/features/garden
parentab737fe92e2631be619c8613da167dd8aab7984b (diff)
downloadskyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.tar.gz
skyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.tar.bz2
skyhanni-3bc84f50fcb86abbe956c9ccbdf52cbdb563af47.zip
Added String.formatLongOrUserError()
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt
index 217b01259..74269c52d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropTimeCommand.kt
@@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.sorted
import at.hannibal2.skyhanni.utils.ItemUtils.itemName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
-import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber
+import at.hannibal2.skyhanni.utils.NumberUtil.formatLongOrUserError
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TimeUtils
@@ -26,13 +26,7 @@ object GardenCropTimeCommand {
return
}
- val rawAmount = args[0]
- val amount = try {
- rawAmount.formatNumber()
- } catch (e: NumberFormatException) {
- ChatUtils.userError("Not a valid number: '$rawAmount'")
- return
- }
+ val amount = args[0].formatLongOrUserError() ?: return
val multipliers = CropMoneyDisplay.multipliers
if (multipliers.isEmpty()) {
ChatUtils.userError("Data not loaded yet. Join the garden and display the money per hour display.")