This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA double exponent problem

 
Lim Cody
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
double pre=(Double.valueOf("58900000"));
System.out.println(pre);

Output is:
5.89E7

May i know how to print output to "58900000" without exponent?
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.text.DecimalFormat
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.printf("%10.0f%n", pre);

But only in Java 5 or Java 6.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic