Here you can find the source of getNumberFormat(final String pattern)
Parameter | Description |
---|---|
pattern | the DecimalFormat pattern. |
public static NumberFormat getNumberFormat(final String pattern)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013, 2014, 2015 QPark Consulting S.a r.l. * //from w ww .java 2 s .c o m * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0. * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html. ******************************************************************************/ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.Locale; public class Main { /** * @param pattern * the {@link DecimalFormat} pattern. * @return The default {@link DecimalFormat} of the pattern with * {@link Locale#ENGLISH}. */ public static NumberFormat getNumberFormat(final String pattern) { DecimalFormat df = new DecimalFormat(pattern, DecimalFormatSymbols.getInstance(Locale.ENGLISH)); return df; } }