aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes preserve double precision Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "preserve double precision" Watch "preserve double precision" New topic
Author

preserve double precision

Saritha Reddy
Greenhorn

Joined: Jun 17, 2004
Posts: 8
Hi,

I declared a variable double as

double d=5;
d=d+0.00;

when I print it, I get as 5.0.I want 5.00.


Can some one help me how to preserve the precition

Thaks in advance
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
Check java.text.DecimalFormat class



Mani
Quaerendo Invenietis
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
http://qa.jtiger.org/GetQAndA.action?qids=46&showAnswers=true


Tony Morris
Java Q&A (FAQ, Trivia)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: preserve double precision