Here you can find the source of formatDouble(double d)
public static String formatDouble(double d)
//package com.java2s; /*/*from w w w. j ava 2s. c o m*/ * train-j is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. */ import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { static NumberFormat nf = new DecimalFormat("0.00000"); public static String formatDouble(double d) { String x = nf.format(d); // String x = shadeDouble(d, 1); return x; } }