Here you can find the source of formatFloat(float f, String format)
public static String formatFloat(float f, String format)
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String formatFloat(float f, String format) { DecimalFormat df = new DecimalFormat(format); return df.format(f); }/* w ww . jav a 2 s.c o m*/ }