public class Test {
public static void main(String[] args) {
//输出3.1415926、22.3456,宽度为14,精度为6,分别左对齐和右对齐。
System.out.printf("%-14.6f %14.6f\n",3.1415926,3.1415926);
System.out.printf("%-14.6f %14.6f\n",22.3456,22.3456);
}
}
public class Test {
public static void main(String[] args) {
//输出3.1415926、22.3456,宽度为14,精度为6,分别左对齐和右对齐。
System.out.printf("%-14.6f %14.6f\n",3.1415926,3.1415926);
System.out.printf("%-14.6f %14.6f\n",22.3456,22.3456);
}
}