Here you can find the source of floatToString(float value)
Parameter | Description |
---|---|
value | a parameter |
public static String floatToString(float value)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www . j a va 2s . co m * convert float to String with two fractional digits * @param value * @return */ public static String floatToString(float value) { if (Float.isNaN(value)) { return " --- "; } return String.format("%.2f", value); } }