|
@@ -31,6 +31,10 @@ public class MinusNode extends OperatorResultNode {
|
|
|
}else if(leftStr.matches(DES_REG)){
|
|
|
/*设计值减去实测的情况:555/555-550*/
|
|
|
return CustomFunction.calculate(CustomFunction.dXd(leftValue, rightValue),-1, StringUtils.getScale(rightValue),3);
|
|
|
+ }else if(leftStr.contains("%")&&rightStr.contains("%")){
|
|
|
+ leftStr=leftStr.replace("%","");
|
|
|
+ rightStr=rightStr.replace("%","");
|
|
|
+ return SubtractUtil.calculate(new BigDecimal(leftStr), new BigDecimal(rightStr))+"%";
|
|
|
}
|
|
|
}
|
|
|
if (!(leftValue instanceof Number)) {
|
|
@@ -52,7 +56,7 @@ public class MinusNode extends OperatorResultNode {
|
|
|
|
|
|
|
|
|
|
|
|
- /*public static void main(String[] args) {
|
|
|
+ /* public static void main(String[] args) {
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
map.put("A","1:2.36");
|
|
|
map.put("B","1:4");
|
|
@@ -66,11 +70,13 @@ public class MinusNode extends OperatorResultNode {
|
|
|
map.put("Z","660/540/570/500");
|
|
|
map.put("X","-10");
|
|
|
map.put("x","10");
|
|
|
+ map.put("kk","65.32%");
|
|
|
+ map.put("kB","63.99%");
|
|
|
new ArrayList<>(Arrays.asList(
|
|
|
- "X-x"
|
|
|
+ "kk-kB"
|
|
|
)).stream().map(s->Expression.parse(s).calculate(map).toString()).forEach(System.out::println);
|
|
|
new ArrayList<>(Arrays.asList(
|
|
|
- "A-B","D-C","C-D","C2-D","E-Z","F-Z","G-Z","H-Z","X-x"
|
|
|
+ "A-B","D-C","C-D","C2-D","E-Z","F-Z","G-Z","H-Z","X-x","kk-kB"
|
|
|
)).stream().map(s->Expression.parse(s).calculate(map).toString()).forEach(System.out::println);
|
|
|
|
|
|
}*/
|