aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/utils/Utils.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-08-20 15:55:04 -0400
committerbowser0000 <bowser0000@gmail.com>2020-08-20 15:55:04 -0400
commitd23181a65d0e49ea612d7d1ea2ae53701cfe7f0b (patch)
tree38788189653f502a3449892f64bf931cae9fe138 /src/main/java/me/Danker/utils/Utils.java
parent4bce023a8c60e165ea1627733f6ada2a2d966350 (diff)
downloadSkyblockMod-d23181a65d0e49ea612d7d1ea2ae53701cfe7f0b.tar.gz
SkyblockMod-d23181a65d0e49ea612d7d1ea2ae53701cfe7f0b.tar.bz2
SkyblockMod-d23181a65d0e49ea612d7d1ea2ae53701cfe7f0b.zip
Add (unfinished) skyblock players command
Still missing JSON key for Jerry Workshop
Diffstat (limited to 'src/main/java/me/Danker/utils/Utils.java')
-rw-r--r--src/main/java/me/Danker/utils/Utils.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index 835e613..7153014 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -113,4 +113,11 @@ public class Utils {
return String.join(" ", words);
}
+ public static double getPercentage(int num1, int num2) {
+ if (num2 == 0) return 0D;
+ double result = ((double) num1 * 100D) / (double) num2;
+ result = Math.round(result * 100D) / 100D;
+ return result;
+ }
+
}