double i = 100000.656321;
NumberFormat form = new DecimalFormat("#,##0.00");
out.println(form.format(i));
顯示結果:100,000.66 (有自動四捨五入)
double i = 100000.656321;
NumberFormat form = new DecimalFormat("#,##0.00");
out.println(form.format(i));
© 著作权归作者所有