double one= Double.parseDouble(1+"");
double two= Double.parseDouble(2+"");
double percent = one/ two;
//获取格式化对象
NumberFormat nt = NumberFormat.getPercentInstance();
//设置百分数精确度2即保留两位小数
nt.setMinimumFractionDigits(2);
//最后格式化并输出
System.out.println("百分数:" + nt.format(percent));