Results 1 to 2 of 2
  1. #1
    josho493 is offline Member
    Join Date
    Apr 2012
    Posts
    6
    Rep Power
    0

    Default What are these values in printf

    I'm looking at some java code and I was wondering what these values are and what changing them will do. I'm referring to the "%14d" and "\n%5s". I looked at the API but I couldn't find much on these specific values. Could someone please describe them to me or point me to more information about it?

    Thanks!
    Java Code:
    System.out.printf("\n%5s", voterID);
    System.out.printf("%14d", MEAN);
    System.out.printf("%14d", MEDIAN);
    System.out.printf("%14d", MODE);
    System.out.printf("%14d", MIN);
    System.out.printf("%14d", MAX);
    System.out.printf("%14d", Favorable);
    System.out.printf("%14d", UnFavorable);

  2. #2
    shall is offline Senior Member
    Join Date
    Apr 2012
    Posts
    199
    Rep Power
    0

    Default Re: What are these values in printf

    Are you looking at the Format String Syntax in Formatter (Java Platform SE 6).

    %14d would mean output a decimal integer data type with a width (=minimum number of characters) of 14.

Similar Threads

  1. printf VS printWriter.printf
    By Mapisto in forum New To Java
    Replies: 14
    Last Post: 01-20-2012, 12:29 PM
  2. printf
    By razzle in forum New To Java
    Replies: 4
    Last Post: 11-12-2010, 02:13 PM
  3. Printf problem!!!
    By pinar in forum New To Java
    Replies: 3
    Last Post: 11-06-2010, 09:44 PM
  4. Printf error
    By ks1615 in forum New To Java
    Replies: 4
    Last Post: 03-10-2009, 06:59 AM
  5. printf
    By Jack in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 04:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •