Need DecimalFormat help.

privatevoid averageButtonActionPerformed(ActionEvent e)

{

DecimalFormat numbers =new DecimalFormat("00.##");

double average = (double)total / 50;

averageField.setText(String.valueOf(average));

}

What would be the proper way to get average to display only the first two digits, rounded up? I'm really new to Java and this is confusing me.

Thanks!

[639 byte] By [mitsukaikiraa] at [2007-10-2 20:14:25]
# 1
Well, I've solved a bit of it on my own, I don't want ("00.##") I want ("##"). Seems I should slow down a bit.Message was edited by: mitsukaikira
mitsukaikiraa at 2007-7-13 22:56:36 > top of Java-index,Java Essentials,New To Java...