Here you can find the source of FormatFloat(float value, int point)
public static String FormatFloat(float value, int point)
//package com.java2s; //License from project: Apache License import java.text.NumberFormat; public class Main { public static String FormatFloat(float value, int point) { NumberFormat numFormat = NumberFormat.getNumberInstance(); numFormat.setMaximumFractionDigits(point); String str = numFormat.format(value); return str; }/*from www. ja v a 2 s. co m*/ }