you can also do this,
public class DecimalPlaces {
public static void main(String[] args) {
double d = 1.234567;
System.out.printf("%1$.2f", d);
}
Type: Posts; User: Freaky Chris
you can also do this,
public class DecimalPlaces {
public static void main(String[] args) {
double d = 1.234567;
System.out.printf("%1$.2f", d);
}