This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.

Just to clarify, Math.round() will always round to the nearest whole number. The reason Kundret's code rounds to the nearest hundredth is because we FIRST multiply it by 100, then, after rounding it, divide by 100 again. This way, you can round to any place, as long as you move the decimal point (by multiplying/dividing) before and after the rounding.

Another alternate to round a double value, make a java.text.DecimalFormat like: static DecimalFormat df=new DecimalFormat("0.00"); use System.out.println(df.format(aDoubleValue)); and it does the rounding.

----------------- Andrew Morris www.devsquare.com DevSquare - Online Application Development