Here you can find the source of format(double d)
Parameter | Description |
---|---|
d | A double. |
public static String format(double d)
//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); } }