Here you can find the source of numberFormatter(String pattern, int maxDigits)
public static DecimalFormat numberFormatter(String pattern, int maxDigits)
//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 }