Results 1 to 9 of 9
  1. #1
    jhetfield18 is offline Member
    Join Date
    Oct 2007
    Posts
    9
    Rep Power
    0

    Default Need help with println

    Hi is it possible to print a double with a precision of 16 digits after the decimal with System.out.println???Or do I have to use System.out.format???
    And before someone says use the .format,I don't want to use it since it's for an exercise and others have used this method too.So I'd like to use the .println,if possible.If not I'll use the other.

    Thx in advance,Nick

  2. #2
    THEAniKan is offline Member
    Join Date
    Sep 2009
    Posts
    15
    Rep Power
    0

    Default

    System.out.printf() should solve your problem:

    Java Code:
    System.out.printf("%.10f", double);
    you can change that "10" to whatever amount of decimal places you need. just don't remove the "%", ".", or "f"

    hope this helps
    :)

  3. #3
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    That question was posted 2 years ago?

  4. #4
    Dieter's Avatar
    Dieter is offline Member
    Join Date
    Sep 2009
    Posts
    91
    Rep Power
    0

    Default

    haha omg :p

  5. #5
    Dieter's Avatar
    Dieter is offline Member
    Join Date
    Sep 2009
    Posts
    91
    Rep Power
    0

    Default

    guess he finally got his answer then :p

  6. #6
    THEAniKan is offline Member
    Join Date
    Sep 2009
    Posts
    15
    Rep Power
    0

    Default

    Guess he finally got his answer then :p
    Thats how I was looking at it

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by THEAniKan View Post
    Thats how I was looking at it
    The last time he has looked at this forum was 12/2007. The odds of his needing this answer now and coming back to look for it are astromically small.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    I have this vision of him sat at his PC for 2 years, waiting...waiting...

    ...and now the blessed release of an answer!

  9. #9
    Dieter's Avatar
    Dieter is offline Member
    Join Date
    Sep 2009
    Posts
    91
    Rep Power
    0

Similar Threads

  1. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 02:30 AM
  2. Template for System.out.println
    By eva in forum Eclipse
    Replies: 3
    Last Post: 01-05-2008, 01:46 PM
  3. Eclipse - shortcut to System.out.println
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-07-2007, 05:21 PM
  4. System.out.println shortcut
    By ravian in forum Eclipse
    Replies: 2
    Last Post: 11-07-2007, 11:17 AM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 09:30 PM

Posting Permissions

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