• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Double Value

 
Natraj Gudla
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a double value which prints a lot of digits after the decimal.
how do i control the number of digits after the decimal.
regards
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the java.text.DecimalFormat class to prepare formatted Strings from your double value -- i.e.,

prints 123.456 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic