23,405
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) throws Exception
{
doubleToString();
double aa = 3100000000.125;
System.out.println(doubleToString(aa));
}
public static String doubleToString(Object value)
{
DecimalFormat df = new DecimalFormat("#,###");
String strValue = df.format(value);
return strValue;
}
public static void doubleToString()
{
double jellen = (1.0/70000000);
System.out.println(jellen);
NumberFormat formatter = NumberFormat.getNumberInstance();
formatter.setMaximumFractionDigits(30); //设置最大小数位
String s = formatter.format(jellen);
System.out.println(s);
}