substring ()
To insert a character in a string at a certain position you can use substring method of java class, whose syntax is -
public String substring(int startIndex, int endIndex)
This method returns a string starting from startIndex ( included ) to the endIndex (excluded) .
int j= 123456
String str = Integer.toString(j);
str = str.substring(0, str.length()-2) + "." +str.substring(str.length()-2);
2. String Buffer
It has similar usage.
String str = Integer.toString(j);
str = new StringBuffer(str).insert(str.length()-2, ".").toString();
3. String Builder
It has faster implementation than String Buffer.
String str = Integer.toString(j);
str = new StringBuilder(str).insert(str.length()-2, ".").toString();