Here you can find the source of toString(double d)
public static String toString(double d)
//package com.java2s; //License from project: LGPL import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { private static NumberFormat SIMPLE_ORDINATE_FORMAT = new DecimalFormat("0.#"); public static String toString(double d) { return SIMPLE_ORDINATE_FORMAT.format(d); }/*from w ww . j av a2 s. co m*/ }