Here you can find the source of floatToString0(float value)
public static String floatToString0(float value)
//package com.java2s; //License from project: Open Source License public class Main { public static String floatToString0(float value) { if (Float.isNaN(value)) { value = 0f;//from ww w.ja va 2s . com } return String.format("%.2f", value); } }