• Post Reply Bookmark Topic Watch Topic
  • New Topic

Double Value  RSS feed

 
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
 
author and iconoclast
Sheriff
Posts: 24217
38
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 .
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!