new DecimalFormat("###.#0").format(你的数字)

解决方案 »

  1.   

    DecimalFormat  df  =  new  DecimalFormat(  ".####");  
    df.format(number)
      

  2.   

    double d = new BigDecimal(你的数字).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
    String s = new DecimalFormat("###.#0").format(d);
      

  3.   

    不好意思public class Haha { public static void main(String[] args) {
    double yourNumber =100.25;
    double d = new BigDecimal(yourNumber).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue();
    String s = new DecimalFormat("#.00").format(d);
    System.out.println(s);
    }
    }