如题。
123.123 -> 123.1230
123.123456789 -> 123.1234
------解决方案--------------------
Double.toString(double)
string.valueof(double)
------解决方案--------------------
//用BigDecimal转一下
public static String doubleToString(double num,int scale) {
return (new BigDecimal(num).divide(new BigDecimal(1.0),scale,BigDecimal.ROUND_HALF_DOWN )).toString();
}