Java Decimal Format getDecimalFormat(String pattern)

Here you can find the source of getDecimalFormat(String pattern)

Description

get Decimal Format

License

Open Source License

Declaration

public static DecimalFormat getDecimalFormat(String pattern) 

Method Source Code

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

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

public class Main {
    public static DecimalFormat getDecimalFormat(String pattern) {
        DecimalFormatSymbols symbols = new DecimalFormatSymbols();
        symbols.setDecimalSeparator('.');
        DecimalFormat format = new DecimalFormat(pattern);
        format.setDecimalFormatSymbols(symbols);
        return format;
    }/*w  w w.j  a v  a2  s .c  o m*/
}

Related

  1. getDecimalFormat(int decimalPlaces, Locale locale)
  2. getDecimalFormat(int precision)
  3. getDecimalFormat(int precision)
  4. getDecimalFormat(int precision, String force)
  5. getDecimalFormat(String format, String sNumber)
  6. getDecimalFormatFix1()
  7. getDecimalFormatSymbols( Locale locale)
  8. getDecimalFormatSymbols(final Locale locale)
  9. getDecimalFormattedNoQuote(String englishFormat)