public class test_format {

  public static void main(String args[]) {

    int    I  = 12345;
    double D  = -12345.6789; //11 digits including + or - sign and .
    String S  = "Hello";

    //Print String on one line
    Format.println(System.out, "%s","hello");

    //Printing String on same line
    for(int i=1;i<=3;++i)
      Format.print(System.out, "%s","hello ");

    //Skip a line
    System.out.println();

    //Printing String on new line
    for(int i=1;i<=3;++i)
      Format.println(System.out, "%s","hello1 ");

    //Printing String on new line using \n
    for(int i=1;i<=3;++i)
      Format.print(System.out, "%s","hello2\n");

    //Print integer
    Format.print(System.out, "Int0: %d  \n",I);
    Format.print(System.out, "Int1: %1d \n",I);
    Format.print(System.out, "Int2: %2d \n",I);
    Format.print(System.out, "Int3: %3d \n",I);
    Format.print(System.out, "Int4: %4d \n",I);
    Format.print(System.out, "Int5: %5d \n",I);
    Format.print(System.out, "Int6: %6d \n",I);

    //Print double
    Format.print(System.out, "Dbl0:  %f \n",     D);
    Format.print(System.out, "Dbl1:  %11f \n",   D);
    Format.print(System.out, "Dbl2:  %11.1f \n", D);
    Format.print(System.out, "Dbl3:  %11.2f \n", D);
    Format.print(System.out, "Dbl4:  %11.3f \n", D);
    Format.print(System.out, "Dbl5:  %11.4f \n", D);
    Format.print(System.out, "Dbl6:  %11.5f \n", D);
    Format.print(System.out, "Dbl7:  %11.6f \n", D);
    Format.print(System.out, "Dbl8:  %11.7f \n", D);
    Format.print(System.out, "Dbl9:  %11.8f \n", D);
    Format.print(System.out, "Dbl10: %11.9f \n", D);
    Format.print(System.out, "Dbl11: %11.10f \n",D);
    Format.print(System.out, "Dbl12: %11.11f \n",D);

    //Try different formats
    Format.print(System.out, "Dbl13: %10.6f \n",D);
    Format.print(System.out, "Dbl14: %5f \n",D);
  }

}
