Here you can find the source of formatDoubleDecimal(float in)
public static String formatDoubleDecimal(float in)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String formatDoubleDecimal(float in) { DecimalFormat df = new DecimalFormat(); df.applyPattern("0.00"); return df.format(in); }/*w w w . j a v a 2 s . c o m*/ }