两个int值的商如何保留一位小数

private String getRate(Integer a, Integer b) {
    DecimalFormat df = new DecimalFormat("0.0");
    return df.format((float) a / b);
}

 

posted @ 2019-12-05 14:33  白玉神驹  阅读(422)  评论(0编辑  收藏  举报