Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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
Pie
Posts: 48954
60
  • 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