添加keep6ScienceStr函数
This commit is contained in:
parent
54d0871dca
commit
a16c039a9c
|
@ -55,6 +55,15 @@ public class NumUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static String keep6ScienceStr(Double value){
|
||||
if (ObjectUtil.isNull(value))
|
||||
return null;
|
||||
String result = NumberUtil.decimalFormat("0.######E00", value);
|
||||
if (!StrUtil.contains(result, "E-"))
|
||||
return StrUtil.replace(result, "E", "E+");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Double keep(Double value, int scale){
|
||||
if (ObjectUtil.isNull(value))
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user