Java Locale Format format(double number)

Here you can find the source of format(double number)

Description

format

License

Apache License

Declaration

public static double format(double number) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

import java.util.Locale;

public class Main {
    private static final DecimalFormat formatter = new DecimalFormat("#.##", new DecimalFormatSymbols(Locale.US));

    public static double format(double number) {
        synchronized (formatter) {
            return new Double(formatter.format(number));
        }//from   ww w. jav  a 2s .c om
    }
}

Related

  1. format(Date date, String pattern, Locale locale)
  2. format(Date inputDate, String format, Locale locale)
  3. format(double d)
  4. format(Double d)
  5. format(Double number)
  6. format(double number, int fractionDigits)
  7. format(double value)
  8. format(double values, boolean doNotFormat)
  9. format(final Date date, final String format)