Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-02-2007, 09:58 AM
Member
 
Join Date: Oct 2007
Posts: 9
Rep Power: 0
jhetfield18 is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 09-14-2009, 04:59 PM
Member
 
Join Date: Sep 2009
Posts: 15
Rep Power: 0
THEAniKan is on a distinguished road
Default
System.out.printf() should solve your problem:

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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-14-2009, 05:04 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
That question was posted 2 years ago?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 09-14-2009, 05:41 PM
Dieter's Avatar
Member
 
Join Date: Sep 2009
Posts: 86
Rep Power: 0
Dieter is on a distinguished road
Default
haha omg
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 09-14-2009, 05:42 PM
Dieter's Avatar
Member
 
Join Date: Sep 2009
Posts: 86
Rep Power: 0
Dieter is on a distinguished road
Default
guess he finally got his answer then
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 09-17-2009, 03:42 PM
Member
 
Join Date: Sep 2009
Posts: 15
Rep Power: 0
THEAniKan is on a distinguished road
Default
Quote:
Guess he finally got his answer then
Thats how I was looking at it
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 09-17-2009, 06:14 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,449
Rep Power: 8
Fubarable is on a distinguished road
Default
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.
__________________
When posting code, please use code tags so that your code is readable. To do this, place the tag [code] before your block of code and [/code] after your block of code.
How to use Code Tags
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 09-17-2009, 06:46 PM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
I have this vision of him sat at his PC for 2 years, waiting...waiting...

...and now the blessed release of an answer!
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 09-18-2009, 09:26 AM
Dieter's Avatar
Member
 
Join Date: Sep 2009
Posts: 86
Rep Power: 0
Dieter is on a distinguished road
Default
haha poor guy
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +2. The time now is 04:46 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org