Package com.earth2me.essentials.utils
Class NumberUtil
java.lang.Object
com.earth2me.essentials.utils.NumberUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
constrainToRange
(int value, int min, int max) Backport from Guava.static String
displayCurrency
(BigDecimal value, IEssentials ess) Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed.static String
displayCurrencyExactly
(BigDecimal value, IEssentials ess) Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed.static String
formatAsCurrency
(BigDecimal value) static String
formatAsPrettyCurrency
(BigDecimal value) static String
formatDouble
(double value) static void
internalSetPrettyFormat
(NumberFormat prettyFormat) static boolean
isHexadecimal
(String sNum) static boolean
static boolean
static boolean
static boolean
isPositiveInt
(String sInt) static BigDecimal
parseStringToBDecimal
(String sArg) static BigDecimal
parseStringToBDecimal
(String sArg, Locale locale) static String
sanitizeCurrencyString
(String input, IEssentials ess) static String
shortCurrency
(BigDecimal value, IEssentials ess)
-
Method Details
-
internalSetPrettyFormat
-
shortCurrency
-
formatDouble
-
formatAsCurrency
-
formatAsPrettyCurrency
-
displayCurrency
Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed. -
displayCurrencyExactly
Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed. -
sanitizeCurrencyString
-
isInt
-
isLong
-
isPositiveInt
-
isNumeric
-
isHexadecimal
-
parseStringToBDecimal
public static BigDecimal parseStringToBDecimal(String sArg, Locale locale) throws ParseException, InvalidModifierException -
parseStringToBDecimal
public static BigDecimal parseStringToBDecimal(String sArg) throws ParseException, InvalidModifierException -
constrainToRange
public static int constrainToRange(int value, int min, int max) Backport from Guava.
-