Here you can find the source of formatInt(int n)
public static String formatInt(int n)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatInt(int n) { return String.format("%,d", n); }//from w ww . j a v a 2 s . c o m }