Java Locale Format format(double d)

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

Description

Formats a double.

License

Open Source License

Parameter

Parameter Description
d A double.

Return

The formatted String.

Declaration

public static String format(double d) 

Method Source Code

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

import java.text.NumberFormat;

import java.util.Locale;

public class Main {
    /**//  w w w .  java 2 s  . c om
     * Formats a double.
     * 
     * @param d
     *            A double.
     * @return The formatted <i>String</i>.
     */
    public static String format(double d) {
        NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH);
        nf.setMinimumFractionDigits(6);
        nf.setMaximumFractionDigits(6);
        return nf.format(d);
    }
}

Related

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