肥宅兜

导航

Java中取两位小数

请参考下面函数:

    private String getFormated(String s){
        float f=Float.parseFloat(s);
        java.text.DecimalFormat   df   =new   java.text.DecimalFormat("#0.00");  
        return df.format(f);
    }

posted on 2016-08-15 14:35  肥宅兜  阅读(668)  评论(0编辑  收藏  举报