public class NumberUtil extends Object
| 构造器和说明 |
|---|
NumberUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
binary2decimal(String number)
二进制转十进制
|
static String |
byte2hex(byte[] bytes) |
static String |
byte2hex(byte[] bytes,
String split) |
static String |
decimal2binary(int number)
二进制转十进制
|
static String |
decimal2hex(int number) |
static String |
format(Number src,
String pattern)
数字格式化
|
static String |
format(String src,
String pattern)
数据格式化
|
static byte |
hex2byte(String inHex) |
static byte[] |
hex2bytes(String hex) |
static int |
hex2decimal(String hex) |
static boolean |
isInt(double src) |
static boolean |
isInt(float src) |
static BigDecimal |
max(BigDecimal... nums)
选取最大数
|
static double |
max(double... nums)
选取最大数
|
static float |
max(float... nums)
选取最大数
|
static int |
max(int... nums)
选取最大数
|
static long |
max(long... nums)
选取最大数
|
static short |
max(short... nums)
选取最大数
|
static BigDecimal |
min(BigDecimal... nums)
选取最小数
|
static double |
min(double... nums)
选取最小数
|
static float |
min(float... nums)
选取最小数
|
static int |
min(int... nums)
选取最小数
|
static long |
min(long... nums)
选取最小数
|
static short |
min(short... nums)
选取最小数
|
static double |
random(double fr,
double to) |
static List<Double> |
random(double fr,
double to,
int qty) |
static float |
random(float fr,
float to) |
static List<Float> |
random(float fr,
float to,
int qty) |
static int |
random(int fr,
int to) |
static List<Integer> |
random(int fr,
int to,
int qty) |
static long |
random(long fr,
long to) |
static List<Long> |
random(long fr,
long to,
int qty) |
static String |
upper(long num)
中文大写(简体)
|
public static String format(String src, String pattern)
src - srcpattern - patternpublic static String format(Number src, String pattern)
src - srcpattern - patternpublic static String upper(long num)
num - numpublic static BigDecimal max(BigDecimal... nums)
nums - numspublic static BigDecimal min(BigDecimal... nums)
nums - numspublic static double max(double... nums)
nums - numspublic static double min(double... nums)
nums - numspublic static int max(int... nums)
nums - numspublic static int min(int... nums)
nums - numspublic static long max(long... nums)
nums - numspublic static long min(long... nums)
nums - numspublic static float max(float... nums)
nums - numspublic static float min(float... nums)
nums - numspublic static short max(short... nums)
nums - numspublic static short min(short... nums)
nums - numspublic static int random(int fr,
int to)
public static double random(double fr,
double to)
public static long random(long fr,
long to)
public static float random(float fr,
float to)
public static boolean isInt(double src)
public static boolean isInt(float src)
public static int binary2decimal(String number)
number - numberpublic static String decimal2binary(int number)
number - numberpublic static int hex2decimal(String hex)
public static String decimal2hex(int number)
public static String byte2hex(byte[] bytes)
public static byte[] hex2bytes(String hex)
public static byte hex2byte(String inHex)
Copyright © 2022. All rights reserved.