|
@@ -925,7 +925,7 @@ public class FormulaUtils {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ /*保留小数缺失的情况会自动识别小数位*/
|
|
public static List<ElementData> setScale(Integer scale, List<ElementData> data){
|
|
public static List<ElementData> setScale(Integer scale, List<ElementData> data){
|
|
if(scale==null){
|
|
if(scale==null){
|
|
scale=StringUtils.getScale(data.stream().map(ElementData::getValue).filter(StringUtils::isDouble).collect(Collectors.toList()));
|
|
scale=StringUtils.getScale(data.stream().map(ElementData::getValue).filter(StringUtils::isDouble).collect(Collectors.toList()));
|
|
@@ -934,6 +934,13 @@ public class FormulaUtils {
|
|
return data.stream().peek(e->{if(StringUtils.isDouble(e.getValue())){e.setValue(StringUtils.number2StringZero(e.getValue(),finalScale));}}).collect(Collectors.toList());
|
|
return data.stream().peek(e->{if(StringUtils.isDouble(e.getValue())){e.setValue(StringUtils.number2StringZero(e.getValue(),finalScale));}}).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*不会自动识别小数位*/
|
|
|
|
+ public static List<ElementData> setScaleMeter(Integer scale, List<ElementData> data){
|
|
|
|
+ if(scale!=null){
|
|
|
|
+ return data.stream().peek(e->{if(StringUtils.isDouble(e.getValue())){e.setValue(StringUtils.number2StringZero(e.getValue(),scale));}}).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description 定位信息排序
|
|
* @Description 定位信息排序
|