When printing a double value using Double.toString(), they always come out with about 8 digits shown. I can't find any way to make the method print shorter versions (say, to 4 decimal places). Is there any way to achieve this, short of writing my own string formatting method? (which I want to avoid...) Thanks.
posted 13 years ago
Use the DecimalFormat class - it should offer you most everything that you might need.
"JavaRanch, where the deer and the Certified play" - David O'Meara