要先引个包
import java.text.DecimalFormat;
public class a {
double x=0.123456;
public float out{
DecimalFormat fmt = new DecimalFormat("0.##");
String str=fmt.format(x);
x=Double.parseDouble(str);
return x;
}
}
发表于 @ 2006年06月10日 17:38:00|评论(loading...)|编辑