Here you can find the source of doubleToString(double dnum)
public static String doubleToString(double dnum)
//package com.java2s; //License from project: Apache License import java.text.NumberFormat; public class Main { public static String doubleToString(double dnum) { NumberFormat numformat = NumberFormat.getNumberInstance(); numformat.setGroupingUsed(false); numformat.setMinimumFractionDigits(2); numformat.setMaximumFractionDigits(2); String valueN = numformat.format(dnum); return valueN; }/*from w w w.j a v a 2 s.c o m*/ }