@@ -938,7 +938,7 @@ public class FormulaUtils {
/*不会自动识别小数位*/
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.stream().peek(e->{if(StringUtils.isDouble(e.getValue())){e.setValue(StringUtils.number2String(e.getValue(),scale));}}).collect(Collectors.toList());
}
return data;
@@ -1185,7 +1185,7 @@ public class StringUtils {
String val = new BigDecimal(handleNull(number)).setScale(handleObj2Integer(scale), BigDecimal.ROUND_HALF_UP).toString();
if (val.contains(".")) {
- return new BigDecimal(val).toString().replaceAll("(0+|\\.0+)$", "");
+ return new BigDecimal(val).stripTrailingZeros().toPlainString();
return val;