尝试了几种方法,比如Math类的四舍五入函数和Bigdecimal,但它不会在十进制值之后舍入。BigDecimalbigDecimal = new BigDecimal(value);value = bigDecimal.doubleValue();
double value = Math.round(decimalValu
BigDecimal value = new BigDecimal("12.000000").setScale(2, RoundingMode.HALF_UP);BigDecimalBigDecimal value = new BigDecimal("12.0051").setScale(2, RoundingMode.HALF_UP);BigDecimalBigDecimal value
at java.lang.Thread.run(Thread.java:745)at java.math.BigDecimal<init>(BigDecimal.java:545)at com.databricks.spark.csv.util.TypeCast$.castTo(TypeCast.sc