Here you can find the source of formatNumberWithThousandSeparator(long number)
public static String formatNumberWithThousandSeparator(long number)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.text.NumberFormat; import java.util.Locale; public class Main { public static String formatNumberWithThousandSeparator(long number) { BigDecimal bd = new BigDecimal(number); NumberFormat formatter = NumberFormat.getInstance(Locale.US); return formatter.format(bd.longValue()); }/* ww w . j av a 2 s.c o m*/ }