日期:2014-05-20 浏览次数:20951 次
public String getQuotient(double dividend,double divisor){
}
int value=(1,405.7682707)
import java.text.DecimalFormat;
public class Test01 {
public static void main(String[] args) {
String str = getQuotient(1, 405.7682707);
System.out.println(str);
}
public static String getQuotient(double dividend,double divisor){
// 这种方式的 E 只能是大写的
// return new DecimalFormat("#.####E0").format(dividend / divisor);
// 而这种方式如果指数小于 2 位数,会变成 e03 这样的
return String.format("%.4e", dividend / divisor);
}
}