Quite lots of ways..^^^
Try to get familiar with some funny stuffs, like:
class test {
public static void main (String args[]) {
double i = 0.5;
double j = 0.3;
Double result = new Double (i/j);
String output = result.toString();
int index = output.indexOf('.');
System.out.println (output.substring(0,index+1+2));
}//main
}
class test {
public static void main (String args[]) {
double i = 0.5;
double j = 0.3;
Double result = new Double (i/j);
String output = result.toString();
int index = output.indexOf('.');
System.out.println (output.substring(0,index+1+2));
}//main
}