diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-12 21:06:29 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-12 21:06:29 +0100 |
commit | a6294dbea249c77f889c068f429e21792c7ce2ea (patch) | |
tree | b17c7e100faf865879bc1a583f0c291f600a5056 /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 9a4bb61b46ca1cd3c8a308c10ffedfe14ecf92fe (diff) | |
download | skyhanni-a6294dbea249c77f889c068f429e21792c7ce2ea.tar.gz skyhanni-a6294dbea249c77f889c068f429e21792c7ce2ea.tar.bz2 skyhanni-a6294dbea249c77f889c068f429e21792c7ce2ea.zip |
reworked and fixed stuff in EliteFarmingWeight by using a tick event
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index bf507962d..91430d923 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -10,6 +10,7 @@ import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.SharedMonsterAttributes import net.minecraft.util.ChatComponentText import java.text.DecimalFormat +import java.text.NumberFormat import java.text.SimpleDateFormat object LorenzUtils { @@ -113,14 +114,15 @@ object LorenzUtils { fun formatPercentage(percentage: Double): String = formatPercentage(percentage, "0.00") fun formatPercentage(percentage: Double, format: String?): String = +// NumberFormat.getPercentInstance().format(percentage) DecimalFormat(format).format(percentage * 100).replace(',', '.') + "%" fun formatInteger(i: Int): String = formatInteger(i.toLong()) - fun formatInteger(l: Long): String = DecimalFormat("#,##0").format(l).replace(',', '.') + fun formatInteger(l: Long): String = NumberFormat.getIntegerInstance().format(l) fun formatDouble(d: Double, format: String?): String = - DecimalFormat(format).format(d).replace(',', 'x').replace('.', ',').replace('x', '.') + NumberFormat.getNumberInstance().format(d) fun formatDouble(d: Double): String = formatDouble(d, "#,##0.0") |