import java.text.DecimalFormat;
double num = 0.258267;
DecimalFormat nf = new DecimalFormat("#####0.00");
System.out.println(nf.format(num));
输出值为: 0.26
import java.text.DecimalFormat;
double num = 0.258267;
DecimalFormat nf = new DecimalFormat("#####0.00");
System.out.println(nf.format(num));
输出值为: 0.26