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