double = 2 decimals

how can i take a double and give it 2 decimals?for example:2 = 2.005.1288 = 5.12
[108 byte] By [rubika] at [2007-10-2 1:39:38]
# 1
java.text.DecimalFormat
jverda at 2007-7-15 19:03:08 > top of Java-index,Java Essentials,Java Programming...
# 2
DecimalFormat twodigits=new DecimalFormat("0.00");
asif_need_javaa at 2007-7-15 19:03:08 > top of Java-index,Java Essentials,Java Programming...
# 3
NOTE: Using DecimalFormat will convert 5.1288 to 5.13 as rounding is performed.
floundera at 2007-7-15 19:03:08 > top of Java-index,Java Essentials,Java Programming...