1
0

2 Commitit add5fc9b7b ... 54a54cff7a

Tekijä SHA1 Viesti Päivämäärä
  yangyj 54a54cff7a 移除0 2 kuukautta sitten
  yangyj 4fed93e41f 移除0 2 kuukautta sitten

+ 1 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -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;
     }

+ 1 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/StringUtils.java

@@ -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;
         }