java converted to a percentage of the format type Double

NumberFormat num = NumberFormat.getPercentInstance();
String rates = num.format(0.03);
System.out.println(rates);//输出3%

 

Published 244 original articles · won praise 16 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_18671415/article/details/105272954