• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

preserve double precision

 
Saritha Reddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check java.text.DecimalFormat class

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic