diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-30 12:09:30 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-30 12:09:30 +0100 |
commit | 3c63e64faba2664ff1f75a6ef5156e2b7303ddba (patch) | |
tree | 6dac35c7a8dc7fd46dfba00bd0e6011ef78d8909 /src/main/java/at/hannibal2/skyhanni | |
parent | d17941f261b027f325615dc985b498380f1450c1 (diff) | |
download | skyhanni-3c63e64faba2664ff1f75a6ef5156e2b7303ddba.tar.gz skyhanni-3c63e64faba2664ff1f75a6ef5156e2b7303ddba.tar.bz2 skyhanni-3c63e64faba2664ff1f75a6ef5156e2b7303ddba.zip |
romanToDecimalIfNeeded -> romanToDecimalIfNecessary (See https://chat.openai.com/share/502571b5-8851-4047-b343-3b1475ca8a88)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
14 files changed, 34 insertions, 34 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenComposterUpgradesData.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenComposterUpgradesData.kt index 6b6d343aa..138158ccb 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenComposterUpgradesData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenComposterUpgradesData.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.composter.ComposterAPI import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -19,7 +19,7 @@ class GardenComposterUpgradesData { val itemName = item.name ?: continue ComposterUpgrade.regex.matchMatcher(itemName) { val name = group("name") - val level = group("level")?.romanToDecimalIfNeeded() ?: 0 + val level = group("level")?.romanToDecimalIfNecessary() ?: 0 val composterUpgrade = ComposterUpgrade.getByName(name)!! ComposterAPI.composterUpgrades?.put(composterUpgrade, level) } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt index 9a0864050..71398af27 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt @@ -13,7 +13,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy import at.hannibal2.skyhanni.utils.LorenzUtils.nextAfter import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.OSUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matches @@ -75,7 +75,7 @@ object GardenCropMilestonesCommunityFix { ) { val name = stack.name ?: return val rawNumber = name.removeColor().replace(crop.cropName, "").trim() - val realTier = if (rawNumber == "") 0 else rawNumber.romanToDecimalIfNeeded() + val realTier = if (rawNumber == "") 0 else rawNumber.romanToDecimalIfNecessary() val lore = stack.getLore() val next = lore.nextAfter({ GardenCropMilestones.totalPattern.matches(it) }, 3) ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 8657f76ee..8c027fcf3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -10,7 +10,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -76,7 +76,7 @@ class MinionCraftHelper { for ((minionName, minionId) in minions) { minionNamePattern.matchMatcher(minionName) { val cleanName = group("name").removeColor() - val number = group("number").romanToDecimalIfNeeded() + val number = group("number").romanToDecimalIfNecessary() addMinion(cleanName, number, minionId, otherItems, newDisplay) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index 5f0a4125e..daf5caddd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt @@ -15,7 +15,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addButton import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision import at.hannibal2.skyhanni.utils.NumberUtil.toRoman import at.hannibal2.skyhanni.utils.RenderUtils.highlight @@ -245,7 +245,7 @@ object BestiaryData { private fun getMobHover(mob: BestiaryMob) = listOf( "§6Name: §b${mob.name}", - "§6Level: §b${mob.level} ${if (!config.replaceRoman) "§7(${mob.level.romanToDecimalIfNeeded()})" else ""}", + "§6Level: §b${mob.level} ${if (!config.replaceRoman) "§7(${mob.level.romanToDecimalIfNecessary()})" else ""}", "§6Total Kills: §b${mob.actualRealTotalKill.formatNumber()}", "§6Kills needed to max: §b${mob.killNeededToMax().formatNumber()}", "§6Kills needed to next lvl: §b${mob.killNeededToNextLevel().formatNumber()}", @@ -459,7 +459,7 @@ object BestiaryData { } - private fun String.romanOrInt() = romanToDecimalIfNeeded().let { + private fun String.romanOrInt() = romanToDecimalIfNecessary().let { if (config.replaceRoman || it == 0) it.toString() else it.toRoman() } @@ -473,7 +473,7 @@ object BestiaryData { if (this == "0") { "I".romanOrInt() } else { - val intValue = romanToDecimalIfNeeded() + val intValue = romanToDecimalIfNecessary() (intValue + 1).toRoman().romanOrInt() } } @@ -486,4 +486,4 @@ object BestiaryData { private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled -}
\ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt index 8bbf2a015..2840565df 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.addOrPut import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf import at.hannibal2.skyhanni.utils.LorenzUtils.getOrNull import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData @@ -115,7 +115,7 @@ class DungeonAPI { DungeonClass.entries.forEach { if (playerTeam.contains("(${it.scoreboardName} ")) { - val level = playerTeam.split(" ").last().trimEnd(')').romanToDecimalIfNeeded() + val level = playerTeam.split(" ").last().trimEnd(')').romanToDecimalIfNecessary() playerClass = it playerClassLevel = level } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt index b824bc6a5..f21274a02 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt @@ -11,7 +11,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded
+import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
@@ -47,11 +47,11 @@ class DungeonFinderFeatures { } else if (itemName == "Entrance") {
event.stackTip = "E"
} else if (itemName.startsWith("Floor ")) {
- event.stackTip = itemName.split(' ').last().romanToDecimalIfNeeded().toString()
+ event.stackTip = itemName.split(' ').last().romanToDecimalIfNecessary().toString()
}
} else if (itemName.startsWith("The Catacombs - ") || itemName.startsWith("MM Catacombs -")) {
val floor = itemName.split(" - ").last().removeColor()
- val floorNum = floor.split(' ').last().romanToDecimalIfNeeded().toString()
+ val floorNum = floor.split(' ').last().romanToDecimalIfNecessary().toString()
val isMasterMode = itemName.contains("MM ")
event.stackTip = if (floor.contains("Entrance")) {
@@ -64,7 +64,7 @@ class DungeonFinderFeatures { } else if (itemName.endsWith("'s Party")) {
val floor = event.stack.getLore().find { it.startsWith("§7Floor: ") } ?: return
val dungeon = event.stack.getLore().find { it.startsWith("§7Dungeon: ") } ?: return
- val floorNum = floor.split(' ').last().romanToDecimalIfNeeded().toString()
+ val floorNum = floor.split(' ').last().romanToDecimalIfNecessary().toString()
val isMasterMode = dungeon.contains("Master Mode")
event.stackTip = if (floor.contains("Entrance")) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt index f6c235cc1..e660fe504 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.features.garden.farming.GardenCropMilestoneDisplay import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @@ -26,7 +26,7 @@ class GardenCropMilestoneFix { val cropName = group("crop") val crop = CropType.getByNameOrNull(cropName) ?: return - val tier = group("tier").romanToDecimalIfNeeded() + val tier = group("tier").romanToDecimalIfNecessary() val crops = GardenCropMilestones.getCropsForTier(tier, crop) changedValue(crop, crops, "level up chat message", 0) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index 62b867719..fe4df931b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -63,7 +63,7 @@ class GardenLevelDisplay { val item = event.inventoryItems[4]!! namePattern.matchMatcher(item.name!!.removeColor()) { - val currentLevel = group("currentLevel").romanToDecimalIfNeeded() + val currentLevel = group("currentLevel").romanToDecimalIfNecessary() var nextLevelExp = 0L for (line in item.getLore()) { expToNextLevelPattern.matchMatcher(line) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 01e0951a5..f65e02107 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -28,7 +28,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.SoundUtils @@ -135,7 +135,7 @@ object ComposterOverlay { event.itemStack?.name?.let { if (it.contains(upgrade.displayName)) { maxLevel = ComposterUpgrade.regex.matchMatcher(it) { - group("level")?.romanToDecimalIfNeeded() ?: 0 + group("level")?.romanToDecimalIfNecessary() ?: 0 } == 25 extraComposterUpgrade = upgrade update() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index 483cce5a5..04fc38a6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -13,7 +13,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -170,7 +170,7 @@ class CaptureFarmingGear { if (event.inventoryName.contains("Your Skills")) { for ((_, item) in event.inventoryItems) { if (item.displayName.contains("Farming ")) { - storage.farmingLevel = item.displayName.split(" ").last().romanToDecimalIfNeeded() + storage.farmingLevel = item.displayName.split(" ").last().romanToDecimalIfNecessary() } } } @@ -226,7 +226,7 @@ class CaptureFarmingGear { ProfileStorageData.playerSpecific?.gardenCommunityUpgrade = group("level").romanToDecimal() } farmingLevelUpPattern.matchMatcher(msg) { - storage.farmingLevel = group("level").romanToDecimalIfNeeded() + storage.farmingLevel = group("level").romanToDecimalIfNecessary() } anitaBuffPattern.matchMatcher(msg) { storage.anitaUpgrade = group("level").toInt() / 4 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt index a4914b2d1..7ace9f0db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt @@ -9,7 +9,7 @@ import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -46,7 +46,7 @@ class GardenInventoryNumbers { event.stack.name?.let { ComposterUpgrade.regex.matchMatcher(it) { - val level = group("level")?.romanToDecimalIfNeeded() ?: 0 + val level = group("level")?.romanToDecimalIfNecessary() ?: 0 event.stackTip = "$level" } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index 6f609def6..72506d4ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -32,7 +32,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.between import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getBottleOfJyrreSeconds import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEdition import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -138,7 +138,7 @@ object ItemDisplayOverlayFeatures { if (!itemName.contains("Dungeon")) { val text = split.last() if (split.size < 2) return "0" - return "" + text.romanToDecimalIfNeeded() + return "" + text.romanToDecimalIfNecessary() } } @@ -149,7 +149,7 @@ object ItemDisplayOverlayFeatures { item.name?.let { if (it.startsWith("§e")) { val text = it.split(" ").last() - return "" + text.romanToDecimalIfNeeded() + return "" + text.romanToDecimalIfNecessary() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index a0f123a7f..8f086626b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -26,7 +26,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.editCopy import at.hannibal2.skyhanni.utils.LorenzUtils.formatInteger import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal -import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.SpecialColour @@ -265,7 +265,7 @@ class MinionFeatures { } minionUpgradePattern.matchMatcher(message) { - val newTier = group("tier").romanToDecimalIfNeeded() + val newTier = group("tier").romanToDecimalIfNecessary() minions?.get(lastMinion)?.let { val minionName = getMinionName(it.displayName, newTier) it.displayName = minionName diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt index 41e5f4923..31062b559 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt @@ -104,7 +104,7 @@ object NumberUtil { fun Number.addSeparators() = NumberFormat.getNumberInstance().format(this) - fun String.romanToDecimalIfNeeded() = toIntOrNull() ?: romanToDecimal() + fun String.romanToDecimalIfNecessary() = toIntOrNull() ?: romanToDecimal() /** * This code was converted to Kotlin and taken under CC BY-SA 3.0 license |