Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int dec= 2;
int i = 13245;
char decimalPoint = '.';
String sNum = "" +i;
String pre = sNum.substring(0, dec);
String suf = sNum.substring(dec+1, sNum.length());
String final = pre +decimalPoint +suf;
System.out.println(final);
String num = "12345";
char[] chars = num.toCharArray();
char sep = '.';
int len = 3;
String final = "";
for (int i=0; i<chars.length; i++)
{
final += chars[i];
if (chars.length-final == len)
final += sep;
}
public putADotInMyString (String number, int dotPosition) {
javax.swing.text.StringContent sc = new javax.swing.text.StringContent();
sc.insertString(0,number);
sc.insertString(dotPosition,".");
return sc.getString(0,number.length()+1);
}