format number of digit for a double value

Hello allHow I can format a double value so that there are only 2 values after the dot.For example 2.332332 -> 2.333.1 -> 3.10Thank you for your helpshuhu
[209 byte] By [suhua] at [2007-11-27 8:12:39]
# 1
DecimalFormat
floundera at 2007-7-12 19:57:03 > top of Java-index,Java Essentials,New To Java...
# 2
I think printf (such as provided by java.io.PrintWriter) can do that as well.
paulcwa at 2007-7-12 19:57:03 > top of Java-index,Java Essentials,New To Java...
# 3
Yeah, I keep forgetting about printf but if you are stuck with < 1.5 you have to go with DecimalFormat.
floundera at 2007-7-12 19:57:03 > top of Java-index,Java Essentials,New To Java...
# 4
Thanks all for your help
suhua at 2007-7-12 19:57:03 > top of Java-index,Java Essentials,New To Java...