Here you can find the source of formatIntWithCommas(int num)
public static String formatIntWithCommas(int num)
//package com.java2s; //License from project: LGPL import java.text.NumberFormat; import java.util.Locale; public class Main { public static String formatIntWithCommas(int num) { return NumberFormat.getNumberInstance(Locale.US).format(num); }//ww w.j av a 2s . co m }