Float re = (Float.parseFloat(replace(b1,","))+Float.parseFloat(replace(b2,",")))-(Float.parseFloat(replace(a1,","))+Float.parseFloat(replace(a2,","))+Float.parseFloat(replace(a3,",")));
String ss = String.valueOf(re);
ss = radixPoint(ss);
}
}
}
public static String replace(String id,String where){
int index = id.indexOf(where);
if(index != -1){
id = id.replaceAll(where, "");
//id = id.substring(0,index) + where + id.substring(index);
id = id.substring(0,index) + id.substring(index);
System.out.println("去除,号后的String:"+id);
}
return id;
}
public static String radixPoint(String ss){
int index = ss.indexOf(".");
if(index != -1){
ss = ss.substring(0,index);
System.out.println("去除小数的String:"+ss);
}
return ss;
}