Java Number Format numberFormatter(String pattern, int maxDigits)

Here you can find the source of numberFormatter(String pattern, int maxDigits)

Description

number Formatter

License

Mozilla Public License

Declaration

public static DecimalFormat numberFormatter(String pattern, int maxDigits) 

Method Source Code


//package com.java2s;
//License from project: Mozilla Public License 

import java.text.DecimalFormat;

public class Main {
    public static DecimalFormat numberFormatter(String pattern, int maxDigits) {
        DecimalFormat f = new DecimalFormat(pattern /*, DecimalFormatSymbols.getInstance(Locale.ENGLISH)*/);
        f.setMaximumFractionDigits(maxDigits);
        return f;
    }//from  w w  w  .  j a  v  a2s .c  om
}

Related

  1. numberFormat(Number number, String... pattern)
  2. numberFormat(String pattern, BigDecimal number)
  3. numberFormat(String pattern, double value)
  4. numberFormate(double num)
  5. numberFormatHelper(String string, double d)