Package host.anzo.commons.utils
Class NumberUtils
java.lang.Object
host.anzo.commons.utils.NumberUtils
- Since:
- 9/8/2021
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longpackIntsToLong(int int1, int int2) Pack to integers to longstatic @NotNull StringtoMetricPrefixedString(long number) unpackIntsFromLong(long packedValue) Unpack two integers from specified long number
-
Constructor Details
-
NumberUtils
public NumberUtils()
-
-
Method Details
-
toMetricPrefixedString
- Parameters:
number- number to convert- Returns:
- number string in metric prefix format.
-
packIntsToLong
public static long packIntsToLong(int int1, int int2) Pack to integers to long- Parameters:
int1- first intint2- second int- Returns:
- long number with two specified packed integers
-
unpackIntsFromLong
public static org.apache.commons.lang3.tuple.Pair<Integer,Integer> unpackIntsFromLong(long packedValue) Unpack two integers from specified long number- Parameters:
packedValue- long number- Returns:
- pair of two unpacked integers
-