Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Begginer Question please help ASAP! (Easy to Answer)

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Begginer Question please help ASAP! (Easy to Answer)

    Hi, first of all i appologise right upfront for not reading your posting rules yet, but i'm in a huge rush atm finishing an assigmnent due tommorow morning and i need a bit of help with a simple printf statement.

    My question is very simple, when using System.out.printf(); statement you can use it to show result from a double. for example i'm showing a value from variable so i say %6.2f meaning 6 digits long and 2 numbers after decimal. So if my number is 5 digits long it will print 5 digits and a blank space at the end to count as the 6th character in the number. My question is if there are 5 numbers, how do i tell it to print the space before the 5 numbers so instead of looking like this:

    number = 54.04 ;

    to look like this

    number = 54.04;

    I tried my very best to explain and in desparate need of help ^^ thank you.


  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Begginer Question please help ASAP! (Easy to Answer)

    well nobody answered but thats ok i managed to work it out, feel free to delete this thread mod.

  3. #3
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,235
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: Begginer Question please help ASAP! (Easy to Answer)

    Can you post your solution? It may help out others in the future.

    I marked the thread as solved.

Similar Threads

  1. Replies: 5
    Last Post: August 5th, 2010, 09:16 PM
  2. [SOLVED] Problem with a tutorial program(Adding the answer of two squared numbers together)
    By Melawe in forum What's Wrong With My Code?
    Replies: 20
    Last Post: April 7th, 2010, 09:03 AM
  3. begginer wondering why his guessing game won't work
    By Ligawulf in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 7th, 2010, 11:22 PM
  4. Arrays.equals not returning correct answer.
    By Anyone in forum Collections and Generics
    Replies: 2
    Last Post: February 11th, 2010, 09:12 AM
  5. Any ideas for begginer?
    By SwEeTAcTioN in forum Java Theory & Questions
    Replies: 11
    Last Post: October 27th, 2009, 03:28 AM