public class main { public static void main(String[] args) { float x = 18000; System.out.println(String.format("%.2f", x));//18000.00 System.out.println(String.format("%,f", x));//18,000.000000 System.out.println(String.format("%,.2f", x));//18,000.00 } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)