public class NumberUtils
extends java.lang.Object
Constructor and Description |
---|
NumberUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
calculateChance(double percentage) |
static boolean |
isInteger(java.lang.String string) |
static boolean |
isValidShort(int integer) |
static int |
randomInt(int min,
int max) |
static double |
round(double value,
int places)
A rounding method for doubles that also specifies up to how many decimal
places there will be.
Credit goes to Jonik from Stack Overflow. |
static int |
safeLongToInt(long l) |
public static boolean calculateChance(double percentage)
public static int safeLongToInt(long l)
public static boolean isValidShort(int integer)
public static double round(double value, int places)
value
- The double you want to round.places
- How many decimals there will be.public static int randomInt(int min, int max)
public static boolean isInteger(java.lang.String string)