格式化数字从右开始隔三个数字加一个逗号
1 int Number=1234567908; 2 StringBuffer numberSB=new StringBuffer(Number+""); 3 int index=numberSB.length(); 4 while(true) { 5 index=index-3; 6 numberSB.insert(index, ","); 7 if(index<=3) { 8 break; 9 } 10 } 11 System.out.println(numberSB.toString());