java - Java - 轉換百分比

117 1


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();

时间: 原作者:

68 0


public String alsProzent(double m, int n) {


 NumberFormat pctFormat = NumberFormat.getPercentInstance();


 pctFormat.setMaximumFractionDigits(n);


 pctFormat.setRoundingMode(RoundingMode.DOWN);


 return pctFormat.format(m);


}



原作者:
...