This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design 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: 48652
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