将数字字符串转成#0.00的货币格式

 1  /**
 2     * 将数字字符串转成#0.00的货币格式
 3     * @param money
 4     * @return 
 5     */
 6     public static String numFormat(String money) {
 7     try {
 8         return new DecimalFormat("#0.00").format(Double.parseDouble(money));
 9         } catch (Exception e) {
10         return "";
11     }
12     }
13     
14     @Test
15     public void demo(){
16         System.out.println(numFormat("5678"));
17     }    
18 
19 输出结果: 5678.00