Here you can find the source of getFormattedTwoDecimal(double d)
public static String getFormattedTwoDecimal(double d)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { public static String getFormattedTwoDecimal(double d) { DecimalFormat df = new DecimalFormat("##.##"); return df.format(d); }/*from w w w. ja va 2s . c om*/ }