Java Locale Format formatNumber(Number num)

Here you can find the source of formatNumber(Number num)

Description

format Number

License

Creative Commons License

Declaration

public static String formatNumber(Number num) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    private static final NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);

    public static String formatNumber(Number num) {
        return getNumberFormat().format(num);

    }/*from   ww w .  j  a v  a2  s .  c  o m*/

    public static NumberFormat getNumberFormat() {
        return numberFormat;
    }
}

Related

  1. formatMessage(String messageKey, Locale locale)
  2. formatMysqlDate(final Date date)
  3. formatNumber(double d, String pattern)
  4. formatNumber(long number)
  5. formatNumber(long value)
  6. formatNumber(Number number)
  7. formatNumber(Number value, int minDecimals, int maxDecimals, boolean grouping, boolean dotDecimalSymbol)
  8. formatNumber(Number value, String format)
  9. formatNumber(Object number, String pattern, Locale locale)