请参考下面函数:
    private String getFormated(String s){
         float f=Float.parseFloat(s);
         java.text.DecimalFormat   df   =new   java.text.DecimalFormat("#0.00");  
         return df.format(f);
     }
本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/xiandedanteng/p/3329060.html,如需转载请自行联系原作者
 
                             
                