double num1 =11;
double num1 =21;
String num1 ="";
DecimalFormat df = new DecimalFormat(".00");
num3 = df.format((num1 - num2)/num2*100);
Sytem.out.println(num3);
运行结果:
num3=52.38
double num1 =11;
double num1 =21;
String num1 ="";
DecimalFormat df = new DecimalFormat(".00");
num3 = df.format((num1 - num2)/num2*100);
Sytem.out.println(num3);
运行结果:
num3=52.38