File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA double exponent problem

 
Lim Cody
Greenhorn
Posts: 6
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.text.DecimalFormat
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • 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