java标准百分比
import java.text.NumberFormat;
public class 百分比 {
public static void main(String[] args) {
int completed=30;
int total=541;
double percentage=((double) completed/(double) total)*100;
NumberFormat numberFormat=NumberFormat.getPercentInstance();
numberFormat.setMinimumFractionDigits(2);
String result=numberFormat.format(((double)completed)/((double)total));
System.out.println(result);
}
}