aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-15 01:36:50 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-15 01:36:50 -0230
commit718740e85f48b57bf712a62f811cd4d34dd98450 (patch)
tree8d3c7751cf684fe98e513010233f7b7b46e3e351 /src/main/java/com/thatgravyboat/skyblockhud/Utils.java
parent89fa98d85546eb93064ce4a2b66e79341750b577 (diff)
downloadSkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.tar.gz
SkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.tar.bz2
SkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.zip
Updated important locations
Updated Config System (Thanks Moulberry) Added Trackers Back with kill trackers
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/Utils.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/Utils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
index b80d5ae..157077b 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/Utils.java
@@ -1,9 +1,13 @@
package com.thatgravyboat.skyblockhud;
+import java.math.RoundingMode;
import java.nio.FloatBuffer;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
+import java.util.Locale;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
@@ -353,4 +357,10 @@ public class Utils {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.popMatrix();
}
+
+ public static String formattedNumber(int number, int numberToFormatAt) {
+ DecimalFormat formatter = new DecimalFormat("#.#", DecimalFormatSymbols.getInstance(Locale.CANADA));
+ formatter.setRoundingMode(RoundingMode.FLOOR);
+ return number > numberToFormatAt-1 ? formatter.format((double) number / 1000) + "k" : String.valueOf(number);
+ }
}