标签:ima string result 运算 类型 ble valueof value java
利用Double.valueOf(str)将str转为double 类型,2个数即可直接相乘、相加减运算
String a="24.3";
String b="3";
double addResult=Double.valueOf(a)+Double.valueOf(b);
double jianResult=Double.valueOf(a)-Double.valueOf(b);
double mutiResult=Double.valueOf(a)*Double.valueOf(b);
BigDecimal c=new BigDecimal(mutiResult);
标签:ima string result 运算 类型 ble valueof value java
原文地址:http://www.cnblogs.com/mywintersweet/p/7727270.html