aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-27 19:01:40 +0900
committersyeyoung <cyong06@naver.com>2021-01-27 19:01:40 +0900
commit4dc9da6c2b23d145583ef528260cc7023a60bdfa (patch)
tree2916b02e3866b03a98092fd38406e3954b552b7c /src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
parentb5cbefcccf5ae5b7d156b181c5cefdcee3861ab8 (diff)
downloadSkyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.gz
Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.bz2
Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.zip
BONZO
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
index a27a1695..01f6ebe3 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
@@ -61,6 +61,16 @@ public class TextUtils {
boolean hasDecimal = (truncated < 100L && (truncated / 10.0D) != (truncated / 10L));
return hasDecimal ? ((truncated / 10.0D) + suffix) : ((truncated / 10L) + suffix);
}
+ public static long reverseFormat(String str2) {
+ String str = str2.toLowerCase();
+ String integerPart = str.substring(0, str.length() - 1);
+ long multiplier = 1;
+ if (str.endsWith("k")) multiplier = 1000;
+ else if (str.endsWith("m")) multiplier = 1000000;
+ else if (str.endsWith("b")) multiplier = 1000000000;
+ else integerPart = str;
+ return (long) (Double.parseDouble(integerPart) * multiplier);
+ }
public static String formatTime(long ms) {
long seconds = ms / 1000;