在对象中设置某个属性返回默认带两位小数

    public void setPassRate(Double passRate) {
        DecimalFormat df = new DecimalFormat("#.00");
        this.passRate = Double.valueOf(df.format(passRate));
    }

 

posted @ 2022-09-19 11:05  liaozk  阅读(38)  评论(0编辑  收藏  举报