java - Java - 转换百分比


package prog1.printtools;


public class PrintTools {


 public static void main(String[] args) {


 public String alsProzent(double m, int n) {


 return


 }


//String Prozentzahldarstellung(double m) = String.format();

时间:


public String alsProzent(double m, int n) {


 NumberFormat pctFormat = NumberFormat.getPercentInstance();


 pctFormat.setMaximumFractionDigits(n);


 pctFormat.setRoundingMode(RoundingMode.DOWN);


 return pctFormat.format(m);


}



...