java.text.DecimalFormat df=new DecimalFormat("0.##");
double d=3.14159
System.out.println(df.format(d));//输出3.14
数字格式类DecimalFormat
最新推荐文章于 2022-12-03 22:32:37 发布

java.text.DecimalFormat df=new DecimalFormat("0.##");
double d=3.14159
System.out.println(df.format(d));//输出3.14