StringBuilder.insert(int offset, float f) has the following syntax.
public StringBuilder insert(int offset, float f)
In the following code shows how to use StringBuilder.insert(int offset, float f) method.
public class Main { public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); //ww w .j av a 2 s . co m float floatValue = 2.5f; buffer.insert(0, floatValue); System.out.println(buffer.toString()); } }
The code above generates the following result.