Here you can find the source of formatDouble(double aValue)
public static String formatDouble(double aValue)
//package com.java2s; //License from project: Apache License import java.math.RoundingMode; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; public class Main { public static String formatDouble(double aValue) { DecimalFormat formatter = new DecimalFormat(); formatter.setGroupingUsed(false); formatter.setMinimumIntegerDigits(1); formatter.setMaximumFractionDigits(100); formatter.setRoundingMode(RoundingMode.DOWN); DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); symbols.setDecimalSeparator('.'); formatter.setDecimalFormatSymbols(symbols); return formatter.format(aValue); }//from w w w . ja va 2 s . c o m }