Java Number Format Pattern getNumberFormat(int maximumFractionDigits)

Here you can find the source of getNumberFormat(int maximumFractionDigits)

Description

Return a number formatter with maximum fraction digits, no grouping, locale ENGLISH.

License

Open Source License

Declaration

public static NumberFormat getNumberFormat(int maximumFractionDigits) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    /** Return a number formatter with maximum fraction digits,
    no grouping, locale ENGLISH. */
    public static NumberFormat getNumberFormat(int maximumFractionDigits) {
        NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH);
        format.setMaximumFractionDigits(maximumFractionDigits);
        format.setGroupingUsed(false);//from  ww  w .  ja v a2  s .  c  om
        return format;
    }
}

Related

  1. getNumberFormat()
  2. getNumberFormat()
  3. getNumberFormat(BigDecimal num, final int digits)
  4. getNumberFormat(double d)
  5. getNumberFormat(final String pattern)
  6. getNumberFormat(String format, Locale locale)
  7. getNumberFormat(String localeStr)
  8. getNumberFormatFromCache(Locale locale, Currency currency)
  9. getNumberFormatInstanceFor2DecimalDigits()