Java Locale Format formatNumberWithThousandSeparator(long number)

Here you can find the source of formatNumberWithThousandSeparator(long number)

Description

format Number With Thousand Separator

License

Open Source License

Declaration

public static String formatNumberWithThousandSeparator(long number) 

Method Source Code

//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*/
}

Related

  1. formatNumber(Object number, String pattern, Locale locale)
  2. formatNumber(Object value, Locale locale)
  3. formatNumber(Object value, String numberFormat)
  4. formatNumberSameWidth(final double v)
  5. formatNumberUk(double inNumber, int inDecimalPlaces)
  6. formatPCT(Object num)
  7. formatPersent(Object input)
  8. formatSmartDate(Date date)
  9. formatString(Object[] args)