Class NumberHelper
java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.NumberHelper
Static helper class for generic number operations
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatPercentage
(double d) static OptionalDouble
parseDouble
(String arg) Parses the arg to a doublestatic OptionalInt
Parses the arg to an integerstatic OptionalLong
Parses the arg to a longstatic Number
Attempts to parse the given string to a number
-
Constructor Details
-
NumberHelper
public NumberHelper()
-
-
Method Details
-
parseInt
Parses the arg to an integer- Parameters:
arg
- The arg to parse- Returns:
- The potential parsed integer
-
parseLong
Parses the arg to a long- Parameters:
arg
- The arg to parse- Returns:
- The potential parsed long
-
parseDouble
Parses the arg to a double- Parameters:
arg
- The arg to parse- Returns:
- The potential parsed double
-
parseNumber
Attempts to parse the given string to a number- Parameters:
s
- The string to parse- Returns:
- The parsed number
-
formatPercentage
-