float x=3.12;
String s=Float.toString(x);
System.out.println(s);

解决方案 »

  1.   

    java.text.NumberFormat怎么用﹖
    ------------------------
    float x=3.12;
    String s=Float.toString(x);
    System.out.println(s);x=999999999999999999999;時我不想他用科學計數法輸出。
    謝謝
      

  2.   

    double x=32432984032.43;   
        DecimalFormat df = new DecimalFormat();
        String y=df.format(x);得到"32,432,984,032.43 "这样可以吗?你想输出的结果是怎么样的?
      

  3.   

    我要顯示為
    32432984032.43
    不要﹐號﹗
    謝謝﹗
    DecimalFormat在哪個包里﹐我找不到﹗
      

  4.   

    i know!
    DecimalFormat df = new DecimalFormat("####.0000");
      

  5.   

    DecimalFormat in in java.text